Analyse des lenteurs depuis le passage à en v15.5

a marqué ce sujet comme résolu.

Bon, je fais des tests et du coup je poste les résultats au fur et à mesure.

Procédure de test

  • Récupérer les tags v1.7c et v15.5b-clementine dans 2 dossiers séparés
  • Récupérer un dump de la BDD datant de la v1.7c et l'importer dans 2 bases MySQL séparées
  • Passer les migrations pour la v15.5b
  • Paramétrer les serveurs en mode DEBUG = False pour éviter les interférences
  • Lancer les 2 serveurs en parallèle et jouer avec ?prof

Ceci garantit que les différences ne viennent pas des données et pas du mode debug.

Tous les tests sont fait sous mon compte (qui est admin, c'est pour pouvoir lancer le profile en mode non debug).

Test sur une page inoffensive

Liste des membres

  • v1.7c : 197 function calls, 0.001 seconds
  • v15.5b : 199 function calls, 0.001 seconds

On vérifie que ce n'est pas un problème généralisé

Sur une page dont le temps de réponse augmente peu

L'accueil des forums

  • v1.7c : 224747 function calls (220822 primitive calls) in 0.403 seconds
  • v15.5b : 237240 function calls (233172 primitive calls) in 0.465 seconds

Les chiffres sont du même ordre de grandeur, le résultat est donc logique.

Résultats bruts - v1.7c

Les deux tableaux de résulta se ressemblent beaucoup, c'est donc logique d'avoir des temps de réponse proches.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
         224747 function calls (220822 primitive calls) in 0.456 seconds

   Ordered by: internal time, call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     5586    0.031    0.000    0.036    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py:6(resolve_columns)
      191    0.019    0.000    0.024    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/cursors.py:315(_do_query)
     5424    0.012    0.000    0.057    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query.py:938(iterator)
      454    0.010    0.000    0.021    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:259(get_default_columns)
      191    0.010    0.000    0.020    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/cursors.py:324(_fetch_row)
      652    0.009    0.000    0.021    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:213(clone)
      196    0.008    0.000    0.029    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:177(get_columns)
     5726    0.008    0.000    0.193    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:706(results_iter)
    10214    0.007    0.000    0.011    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:49(quote_name_unless_alias)
     5013    0.007    0.000    0.007    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:294(quote_name)
      876    0.007    0.000    0.029    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1331(setup_joins)
   383/66    0.006    0.000    0.034    0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:618(fill_related_selections)
        2    0.006    0.003    0.078    0.039 /home/spacefox/Dev/Django/zds-site-old/zds/utils/templatetags/topbar.py:18(top_categories)
      876    0.006    0.000    0.012    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1251(names_to_path)
     1131    0.006    0.000    0.018    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/functional.py:197(wrapper)
      478    0.006    0.000    0.008    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/base.py:325(__init__)
  196/190    0.005    0.000    0.104    0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:65(as_sql)
      196    0.005    0.000    0.007    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:509(get_from_clause)
     1193    0.005    0.000    0.007    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:833(join)
    218/1    0.004    0.000    0.401    0.401 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:836(render)
      297    0.004    0.000    0.035    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1011(build_filter)
     1780    0.004    0.000    0.004    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/datastructures.py:127(__init__)
      393    0.004    0.000    0.009    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:687(__init__)
      687    0.004    0.000    0.233    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:752(_resolve_lookup)
     2327    0.004    0.000    0.004    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/encodings/utf_8.py:15(decode)
      165    0.004    0.000    0.015    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/core/urlresolvers.py:396(_reverse_with_prefix)
      314    0.004    0.000    0.012    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:538(__init__)
    147/3    0.004    0.000    0.033    0.011 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:241(parse)
     5241    0.003    0.000    0.003    0.000 :8(__new__)
      416    0.003    0.000    0.003    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/times.py:44(DateTime_or_None)
      215    0.003    0.000    0.010    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/fields/related.py:1071(get_lookup_constraint)
4106/4095    0.003    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/encoding.py:84(force_text)
      313    0.003    0.000    0.005    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1383(trim_joins)
      290    0.003    0.000    0.012    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/where.py:166(make_atom)
     1054    0.003    0.000    0.004    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:201(create_token)

 ---- By file ----

      tottime
13.6%   0.057 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py
13.4%   0.056 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py
10.3%   0.043 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/cursors.py
 8.1%   0.034 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py
 7.4%   0.031 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py
 6.9%   0.029 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query.py
 3.3%   0.014 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/fields/related.py
 2.9%   0.012 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/options.py
 2.9%   0.012 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/where.py
 2.4%   0.010 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/functional.py
 2.4%   0.010 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/datastructures.py
 2.4%   0.010 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py
 1.9%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/debug.py
 1.9%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py
 1.7%   0.007 /home/spacefox/Dev/Django/zds-site-old/zds/utils/templatetags/topbar.py
 1.4%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/base.py
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/tree.py
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/core/urlresolvers.py
 1.0%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/text.py
 1.0%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query_utils.py
 1.0%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/encodings/utf_8.py
 0.7%   0.003 
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/safestring.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/defaulttags.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/utils.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/times.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/connections.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/re.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/six.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/regex_helper.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/formats.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/encoding.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/dateformat.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/templatetags/i18n.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/util.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/__init__.py
 0.2%   0.001 /usr/lib/python2.7/urllib.py
 0.2%   0.001 /usr/lib/python2.7/copy.py
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/itercompat.py

 ---- By group ---

      tottime
58.9%   0.247 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db
11.7%   0.049 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb
11.2%   0.047 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils
11.0%   0.046 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template
 1.9%   0.008 /home/spacefox/Dev/Django/zds-site-old/zds/utils/templatetags
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/core
 1.0%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/encodings
 1.0%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7
 0.7%   0.003 
 0.5%   0.002 /usr/lib/python2.7
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/templatetags
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/dispatch
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/conf
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/social/apps/django_app
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/smmap
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/gitdb/utils
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/gitdb/db
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/gitdb
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git/repo
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git/refs
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git/objects
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/shortcuts
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/middleware
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/http
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/contrib
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site-old/zds/utils
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site-old/zds/member
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site-old/zds/forum

Résultats bruts - v15.5b

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
         237240 function calls (233172 primitive calls) in 0.474 seconds

   Ordered by: internal time, call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     5596    0.029    0.000    0.033    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py:6(resolve_columns)
      201    0.023    0.000    0.028    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py:315(_do_query)
      444    0.014    0.000    0.025    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:274(get_default_columns)
     5424    0.012    0.000    0.054    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/query.py:1072(iterator)
      733    0.010    0.000    0.016    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:240(clone)
      201    0.009    0.000    0.018    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py:324(_fetch_row)
      206    0.008    0.000    0.032    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:192(get_columns)
     1157    0.008    0.000    0.018    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1364(names_to_path)
     5746    0.007    0.000    0.195    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:693(results_iter)
     9738    0.007    0.000    0.010    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:50(__call__)
      468    0.006    0.000    0.009    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/base.py:360(__init__)
      850    0.006    0.000    0.030    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1435(setup_joins)
     4797    0.006    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:320(quote_name)
     1148    0.006    0.000    0.018    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/functional.py:208(wrapper)
  206/200    0.005    0.000    0.107    0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:82(as_sql)
   353/56    0.005    0.000    0.033    0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:610(fill_related_selections)
     1153    0.005    0.000    0.008    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:902(join)
        2    0.005    0.002    0.073    0.037 /home/spacefox/Dev/Django/zds-site/zds/utils/templatetags/topbar.py:18(top_categories)
     5221    0.005    0.000    0.005    0.000 :8(__new__)
      410    0.005    0.000    0.009    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:683(__init__)
      206    0.004    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:502(get_from_clause)
     1516    0.004    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/related.py:1440(foreign_related_fields)
      687    0.004    0.000    0.236    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:751(_resolve_lookup)
      307    0.004    0.000    0.046    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1152(build_filter)
      165    0.004    0.000    0.016    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py:408(_reverse_with_prefix)
      205    0.004    0.000    0.010    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/related.py:1524(get_lookup_constraint)
      405    0.004    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1483(trim_joins)
     2308    0.004    0.000    0.004    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/encodings/utf_8.py:15(decode)
      329    0.003    0.000    0.012    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:549(__init__)
    152/6    0.003    0.000    0.031    0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:253(parse)
      405    0.003    0.000    0.003    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/times.py:44(DateTime_or_None)
 1058/430    0.003    0.000    0.019    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:74(compile)
4069/4058    0.003    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/encoding.py:65(force_text)
     1026    0.003    0.000    0.003    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/safestring.py:117(mark_safe)
      683    0.003    0.000    0.020    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/query.py:940(_clone)
 ---- By file ----

      tottime
14.5%   0.063 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py
14.1%   0.061 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py
10.9%   0.047 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py
 7.2%   0.031 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py
 7.2%   0.031 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/query.py
 6.7%   0.029 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py
 4.6%   0.020 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/related.py
 2.1%   0.009 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/functional.py
 2.1%   0.009 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/options.py
 1.8%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py
 1.8%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py
 1.6%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/debug.py
 1.4%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/where.py
 1.4%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/lookups.py
 1.4%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/base.py
 1.4%   0.006 /home/spacefox/Dev/Django/zds-site/zds/utils/templatetags/topbar.py
 1.2%   0.005 
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/tree.py
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/defaulttags.py
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py
 0.9%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/text.py
 0.9%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/utils.py
 0.9%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/query_utils.py
 0.9%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/encodings/utf_8.py
 0.7%   0.003 /usr/lib/python2.7/copy.py
 0.7%   0.003 /usr/lib/python2.7/collections.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/safestring.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/utils.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/times.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/connections.py
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/re.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/six.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/regex_helper.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/html.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/formats.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/encoding.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/dateformat.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/templatetags/i18n.py
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/__init__.py

 ---- By group ---

      tottime
60.5%   0.262 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db
12.2%   0.053 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb
10.2%   0.044 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template
 8.5%   0.037 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils
 1.6%   0.007 /usr/lib/python2.7
 1.6%   0.007 /home/spacefox/Dev/Django/zds-site/zds/utils/templatetags
 1.2%   0.005 
 1.2%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/core
 0.9%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/encodings
 0.7%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7
 0.5%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/templatetags
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/gitdb
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/dispatch
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/conf
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/social/apps/django_app
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/smmap
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/gitdb/utils
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/gitdb/db
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git/repo
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git/refs
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git/objects
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/test
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/shortcuts.py
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/middleware
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/http
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/contrib
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/debug_toolbar/panels/templates
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site/zds/utils
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site/zds/member
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site/zds/forum

Test d'une page problématique

La page de catégorie "Le bar à smoothies".

  • v1.7c : 315875 function calls (307298 primitive calls) in 0.584 seconds
  • v15.5b : 373670 function calls (364559 primitive calls) in 0.716 seconds

La nouvelle version est sensiblement plus lourde : environ 20% d'appels de fonction en plus

Résultats bruts - v1.7c

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
         315875 function calls (307298 primitive calls) in 0.584 seconds

   Ordered by: internal time, call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
      235    0.029    0.000    0.035    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/cursors.py:315(_do_query)
     2975    0.018    0.000    0.021    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py:6(resolve_columns)
      639    0.013    0.000    0.026    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:259(get_default_columns)
      239    0.011    0.000    0.038    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:177(get_columns)
      817    0.010    0.000    0.024    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:213(clone)
     2054    0.010    0.000    0.030    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/functional.py:197(wrapper)
    14913    0.010    0.000    0.016    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:49(quote_name_unless_alias)
  594/119    0.010    0.000    0.050    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:618(fill_related_selections)
      235    0.009    0.000    0.023    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/cursors.py:324(_fetch_row)
     7256    0.009    0.000    0.009    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:294(quote_name)
     1630    0.009    0.000    0.324    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:752(_resolve_lookup)
    539/1    0.008    0.000    0.538    0.538 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:836(render)
     1234    0.008    0.000    0.037    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1331(setup_joins)
      758    0.008    0.000    0.011    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/base.py:325(__init__)
     1234    0.008    0.000    0.015    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1251(names_to_path)
      687    0.007    0.000    0.015    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:687(__init__)
      555    0.007    0.000    0.021    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:538(__init__)
    246/3    0.006    0.000    0.063    0.021 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:241(parse)
     1680    0.006    0.000    0.009    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:833(join)
  239/234    0.006    0.000    0.135    0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:65(as_sql)
8492/8481    0.006    0.000    0.011    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/encoding.py:84(force_text)
     3926    0.006    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/encodings/utf_8.py:15(decode)
      420    0.005    0.000    0.015    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/options.py:456(get_all_related_objects_with_model)
      239    0.005    0.000    0.008    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:509(get_from_clause)
      789    0.005    0.000    0.005    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/times.py:44(DateTime_or_None)
      249    0.005    0.000    0.023    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/core/urlresolvers.py:396(_reverse_with_prefix)
     3141    0.005    0.000    0.214    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:706(results_iter)
      414    0.005    0.000    0.044    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1011(build_filter)
     2303    0.005    0.000    0.005    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/datastructures.py:127(__init__)
     1660    0.005    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py:201(create_token)
     2740    0.005    0.000    0.025    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query.py:938(iterator)
      328    0.005    0.000    0.014    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/fields/related.py:1071(get_lookup_constraint)
     7933    0.004    0.000    0.004    0.000 :8(__new__)
  594/119    0.004    0.000    0.017    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query.py:1153(get_klass_info)
     1948    0.004    0.000    0.004    0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/safestring.py:104(mark_safe)

 ---- By file ----

      tottime
13.0%   0.068 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py
12.2%   0.064 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/query.py
11.5%   0.060 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py
 9.9%   0.052 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/cursors.py
 4.8%   0.025 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query.py
 3.4%   0.018 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py
 3.2%   0.017 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/fields/related.py
 3.1%   0.016 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/options.py
 2.9%   0.015 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/functional.py
 2.9%   0.015 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/debug.py
 2.9%   0.015 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/sql/where.py
 2.5%   0.013 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/datastructures.py
 1.9%   0.010 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py
 1.7%   0.009 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py
 1.7%   0.009 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/base.py
 1.3%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/defaulttags.py
 1.3%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/core/urlresolvers.py
 1.1%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/tree.py
 1.1%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/text.py
 1.1%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/encodings/utf_8.py
 1.0%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/utils.py
 1.0%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/models/query_utils.py
 1.0%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/times.py
 0.8%   0.004 
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/safestring.py
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/encoding.py
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/dateformat.py
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/templatetags/i18n.py
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb/connections.py
 0.6%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/six.py
 0.6%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/regex_helper.py
 0.6%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils/formats.py
 0.6%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/context.py
 0.6%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/re.py
 0.4%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/smartif.py
 0.4%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/defaultfilters.py
 0.4%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/util.py
 0.4%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db/backends/__init__.py
 0.4%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/conf/__init__.py

 ---- By group ---

      tottime
51.0%   0.267 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db
17.2%   0.090 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template
13.4%   0.070 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/utils
11.6%   0.061 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/MySQLdb
 1.3%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/core
 1.1%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7/encodings
 1.0%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv-old/lib/python2.7
 0.8%   0.004 
 0.8%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/templatetags
 0.6%   0.003 /usr/lib/python2.7
 0.6%   0.003 /home/spacefox/Dev/Django/zds-site-old/zds/utils/templatetags
 0.4%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/conf
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/shortcuts
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/dispatch
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/social/apps/django_app
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/smmap
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/gitdb/utils
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/gitdb/db
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/gitdb
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git/repo
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git/refs
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git/objects
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/git
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/middleware
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/http
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/contrib
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site-old/zds/utils
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site-old/zds/member
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site-old/zds/forum

Résultats bruts - v15.5b

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
         373670 function calls (364559 primitive calls) in 0.716 seconds

   Ordered by: internal time, call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     5167    0.039    0.000    0.039    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:166(__init__)
      268    0.022    0.000    0.029    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py:315(_do_query)
      606    0.017    0.000    0.031    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:274(get_default_columns)
     3008    0.017    0.000    0.019    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py:6(resolve_columns)
     2229    0.016    0.000    0.033    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:683(__init__)
     1845    0.015    0.000    0.049    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:549(__init__)
     3554    0.015    0.000    0.037    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/functional.py:208(wrapper)
   792/75    0.013    0.000    0.117    0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:253(parse)
      975    0.012    0.000    0.019    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:240(clone)
     5167    0.010    0.000    0.049    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:212(create_token)
      272    0.010    0.000    0.040    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:192(get_columns)
     1584    0.009    0.000    0.022    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1364(names_to_path)
     1630    0.009    0.000    0.299    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:751(_resolve_lookup)
       75    0.008    0.000    0.062    0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/debug.py:13(tokenize)
      725    0.008    0.000    0.011    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/base.py:360(__init__)
    13257    0.008    0.000    0.012    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:50(__call__)
     7787    0.008    0.000    0.008    0.000 :8(__new__)
     1137    0.008    0.000    0.037    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1435(setup_joins)
    504/1    0.007    0.000    0.694    0.694 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:840(render)
     6532    0.007    0.000    0.007    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py:320(quote_name)
   495/86    0.007    0.000    0.046    0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:610(fill_related_selections)
      268    0.006    0.000    0.019    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py:324(_fetch_row)
     2398    0.006    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/safestring.py:117(mark_safe)
  272/267    0.006    0.000    0.136    0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:82(as_sql)
9059/9048    0.006    0.000    0.011    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/encoding.py:65(force_text)
     2669    0.006    0.000    0.006    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/text.py:369(smart_split)
     1548    0.006    0.000    0.009    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:902(join)
     2108    0.006    0.000    0.008    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/related.py:1440(foreign_related_fields)
      249    0.006    0.000    0.023    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py:408(_reverse_with_prefix)
     3877    0.005    0.000    0.005    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/encodings/utf_8.py:15(decode)
     5167    0.005    0.000    0.054    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/debug.py:28(create_token)
     4429    0.005    0.000    0.005    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py:313(extend_nodelist)
      447    0.005    0.000    0.057    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py:1152(build_filter)
      277    0.005    0.000    0.021    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/templatetags/i18n.py:309(do_translate)
      272    0.005    0.000    0.007    0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py:502(get_from_clause)
 ---- By file ----

      tottime
20.9%   0.138 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/base.py
11.7%   0.077 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/query.py
10.9%   0.072 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py
 6.7%   0.044 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/cursors.py
 4.4%   0.029 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/related.py
 4.2%   0.028 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/query.py
 3.6%   0.024 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/debug.py
 3.0%   0.020 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/functional.py
 2.6%   0.017 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/compiler.py
 2.0%   0.013 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/defaulttags.py
 1.7%   0.011 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/options.py
 1.7%   0.011 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/text.py
 1.5%   0.010 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py
 1.4%   0.009 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/lookups.py
 1.4%   0.009 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py
 1.2%   0.008 
 1.2%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/base.py
 1.2%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/core/urlresolvers.py
 1.1%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/tree.py
 1.1%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/safestring.py
 1.1%   0.007 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/sql/where.py
 0.9%   0.006 /usr/lib/python2.7/collections.py
 0.9%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/templatetags/i18n.py
 0.8%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/models/query_utils.py
 0.8%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/times.py
 0.8%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/encodings/utf_8.py
 0.6%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py
 0.6%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/six.py
 0.6%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/dateformat.py
 0.6%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/context.py
 0.6%   0.004 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/utils.py
 0.5%   0.003 /usr/lib/python2.7/copy.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/regex_helper.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/formats.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils/encoding.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/smartif.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template/loaders/filesystem.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/utils.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db/backends/__init__.py
 0.5%   0.003 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb/connections.py

 ---- By group ---

      tottime
44.7%   0.295 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/db
28.3%   0.187 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template
11.1%   0.073 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/utils
 7.9%   0.052 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/MySQLdb
 2.0%   0.013 /usr/lib/python2.7
 1.2%   0.008 
 1.2%   0.008 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/core
 0.9%   0.006 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/templatetags
 0.8%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7/encodings
 0.8%   0.005 /home/spacefox/Dev/virtualenvs/zdsenv/lib/python2.7
 0.5%   0.003 /home/spacefox/Dev/Django/zds-site/zds/utils/templatetags
 0.3%   0.002 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/conf
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/gitdb
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git
 0.2%   0.001 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/dispatch
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/social/apps/django_app
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/smmap
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/gitdb/utils
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/gitdb/db
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git/repo
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git/refs
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/git/objects
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/test
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/shortcuts.py
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/middleware
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/http
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/contrib
 0.0%   0.000 /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/debug_toolbar/panels/templates
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site/zds/utils
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site/zds/member
 0.0%   0.000 /home/spacefox/Dev/Django/zds-site/zds/forum

Le problème viendrait en réalité des templates : le fichier /virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/template/base.py passe de la 3ème à la 1ère place dans les fichiers les plus consommateurs, et l'occupation de /home/spacefox/Dev/virtualenvs/zdsenv/local/lib/python2.7/site-packages/django/template augmente sensiblement.

Cela dit, on dirait quand même que le temps passé dans /home/spacefox/Dev/virtualenvs/zdsenv-old/local/lib/python2.7/site-packages/django/db augmente. Alors on va essayer en mode debug activé pour essayer d'y voir plus clair.

Avec le mode debug

Catégorie de forum, connecté

On fait beaucoup plus de requêtes SQL en v15.5 qu'en v1.7 ! 271 requêtes au lieu de 238. Il s'agit visiblement de beaucoup de requêtes du genre :

1
SELECT ••• FROM `auth_user` WHERE `auth_user`.`id` = 258 LIMIT 21

qui sont apparues entre les 2 versions.

Index des forum, connecté

Un peu plus de requêtes en v15.5 qu'en v1.7 (204 contre 193)

Page de forum (la même), connecté

Un peu plus de requêtes en v15.5 qu'en v1.7 (193 contre 182)

Catégorie de forum, déconnecté

Même remarque et même requêtes qu'en mode connecté (153 requêtes contre 129)

Index des forum, déconnecté

Nombre de requêtes presque identiques (79 contre 78)

Page de forum (la même), déconnecté

C'est là qu'on remarque qu'afficher toutes les fioritures des forums est très lourd, puisqu'on passe à 32 requêtes en v1.7 et 33 en v15.5 !

D'après ce que je lis dans ton analyse et ce que j'en lis dans la seule PR qui touche aux forums et à ses catégories, je me dis que les problèmes de performances que tu soulignais étaient peut-être justifiées.

Qu'en penses-tu ?

J'en suis pas sûr, pour moi il faudrait creuser plus en détail que je ne peux le faire ce soir.

PS : par contre ce qui est à peu près sûr, c'est que ces 3 plans d'actions permettraient de gagner pas mal en performances :

  1. Fusionner les 2 tables d'utilisateurs
  2. Trouver un moyen pour qu'afficher une page de forum pour un connecté soit moins lourd
  3. [nécessite django 1.8] passer à Jinja2 pour le moteur de templates
Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte