static[0]
138017 function calls in 0.818 seconds
Ordered by: internal time
List reduced from 79 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
1000 0.062 0.000 0.490 0.000 base.py:72(get_response)
2000 0.047 0.000 0.129 0.000 base.py:240(get_script_name)
1000 0.042 0.000 0.758 0.001 wsgi.py:210(__call__)
1000 0.040 0.000 0.247 0.000 urlresolvers.py:293(resolve)
1000 0.039 0.000 0.136 0.000 wsgi.py:129(__init__)
2000 0.031 0.000 0.052 0.000
trans_real.py:212(get_language)
7000 0.031 0.000 0.044 0.000 functional.py:182(inner)
3000 0.029 0.000 0.088 0.000 encoding.py:54(force_unicode)
14002 0.029 0.000 0.029 0.000 {isinstance}
1000 0.027 0.000 0.081 0.000 __init__.py:564(__init__)
static[-1]
1929017 function calls in 10.654 seconds
Ordered by: internal time
List reduced from 80 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
201000 2.998 0.000 4.928 0.000
trans_real.py:212(get_language)
200000 1.288 0.000 8.378 0.000 urlresolvers.py:195(resolve)
1000 1.175 0.001 9.973 0.010 urlresolvers.py:293(resolve)
408000 1.085 0.000 1.085 0.000 {getattr}
206000 0.879 0.000 1.231 0.000 functional.py:182(inner)
201000 0.878 0.000 6.577 0.000 urlresolvers.py:153(regex)
201000 0.755 0.000 5.682 0.000 __init__.py:128(get_language)
201000 0.547 0.000 0.547 0.000 {method 'search' of
'_sre.SRE_Pattern' objects}
199000 0.290 0.000 0.290 0.000 {method 'append' of 'list'
objects}
1000 0.094 0.000 10.272 0.010 base.py:72(get_response)
dynamic[0]
3745017 function calls in 20.459 seconds
Ordered by: internal time
List reduced from 80 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
402000 6.006 0.000 9.866 0.000
trans_real.py:212(get_language)
401000 2.528 0.000 16.700 0.000 urlresolvers.py:195(resolve)
1000 2.301 0.002 19.733 0.020 urlresolvers.py:293(resolve)
810000 2.162 0.000 2.162 0.000 {getattr}
402000 1.735 0.000 13.107 0.000 urlresolvers.py:153(regex)
407000 1.731 0.000 2.424 0.000 functional.py:182(inner)
402000 1.489 0.000 11.355 0.000 __init__.py:128(get_language)
402000 1.098 0.000 1.098 0.000 {method 'search' of
'_sre.SRE_Pattern' objects}
400000 0.571 0.000 0.571 0.000 {method 'append' of 'list'
objects}
1000 0.137 0.000 20.076 0.020 base.py:72(get_response)
dynamic[-1]
3916017 function calls in 29.633 seconds
Ordered by: internal time
List reduced from 80 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
421000 8.650 0.000 14.267 0.000
trans_real.py:212(get_language)
420000 3.693 0.000 24.279 0.000 urlresolvers.py:195(resolve)
1000 3.299 0.003 28.606 0.029 urlresolvers.py:293(resolve)
848000 3.112 0.000 3.112 0.000 {getattr}
426000 2.552 0.000 3.592 0.000 functional.py:182(inner)
421000 2.527 0.000 18.993 0.000 urlresolvers.py:153(regex)
421000 2.176 0.000 16.443 0.000 __init__.py:128(get_language)
421000 1.639 0.000 1.639 0.000 {method 'search' of
'_sre.SRE_Pattern' objects}
419000 0.805 0.000 0.805 0.000 {method 'append' of 'list'
objects}
1000 0.211 0.000 29.103 0.029 base.py:72(get_response)
seo[0]
1941017 function calls in 14.737 seconds
Ordered by: internal time
List reduced from 80 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
202000 4.162 0.000 6.855 0.000
trans_real.py:212(get_language)
201000 1.787 0.000 11.599 0.000 urlresolvers.py:195(resolve)
1000 1.594 0.002 13.797 0.014 urlresolvers.py:293(resolve)
410000 1.497 0.000 1.497 0.000 {getattr}
207000 1.243 0.000 1.747 0.000 functional.py:182(inner)
202000 1.230 0.000 9.164 0.000 urlresolvers.py:153(regex)
202000 1.056 0.000 7.911 0.000 __init__.py:128(get_language)
202000 0.693 0.000 0.693 0.000 {method 'search' of
'_sre.SRE_Pattern' objects}
200000 0.402 0.000 0.402 0.000 {method 'append' of 'list'
objects}
1000 0.143 0.000 14.221 0.014 base.py:72(get_response)
seo[-1]
2022017 function calls in 15.401 seconds
Ordered by: internal time
List reduced from 80 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
211000 4.360 0.000 7.189 0.000
trans_real.py:212(get_language)
210000 1.872 0.000 12.135 0.000 urlresolvers.py:195(resolve)
1000 1.698 0.002 14.454 0.014 urlresolvers.py:293(resolve)
428000 1.565 0.000 1.565 0.000 {getattr}
216000 1.311 0.000 1.834 0.000 functional.py:182(inner)
211000 1.289 0.000 9.584 0.000 urlresolvers.py:153(regex)
211000 1.084 0.000 8.272 0.000 __init__.py:128(get_language)
211000 0.725 0.000 0.725 0.000 {method 'search' of
'_sre.SRE_Pattern' objects}
209000 0.414 0.000 0.414 0.000 {method 'append' of 'list'
objects}
1000 0.148 0.000 14.884 0.015 base.py:72(get_response)
missing
8865573 function calls (8775573 primitive calls) in 57.023 seconds
Ordered by: internal time
List reduced from 225 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
122000/62000 10.171 0.000 18.105 0.000 pprint.py:247(_safe_repr)
421000 8.741 0.000 14.432 0.000
trans_real.py:212(get_language)
420000 3.723 0.000 24.273 0.000 urlresolvers.py:195(resolve)
938000 3.385 0.000 3.385 0.000 {getattr}
1000 3.350 0.003 28.598 0.029 urlresolvers.py:293(resolve)
1405000 3.170 0.000 3.170 0.000 {method 'write' of
'cStringIO.StringO' objects}
443000 2.728 0.000 3.817 0.000 functional.py:182(inner)
1338000 2.570 0.000 2.570 0.000 {method 'isalpha' of 'str'
objects}
421000 2.560 0.000 19.159 0.000 urlresolvers.py:153(regex)
421000 2.141 0.000 16.573 0.000 __init__.py:128(get_language)
On Friday, October 12, 2012 12:47:51 PM UTC+3, Tom Evans wrote:
>
> It definitely doesn't help; ideally language code should be calculated
> once per call to resolve, and the same value used throughout.
> Hard-coding a value of 'en' for language code in
> LocaleRegexProvider.regex gives an idea of what gains would be:
>
> Stock django:
>
> static[0] msec rps tcalls funcs
> django 1583 6318 143 69
>
> static[-1] msec rps tcalls funcs
> django 20879 479 1934 70
>
>
> Hard coded 'en' in LocaleRegexProvider.regex:
>
> static[0] msec rps tcalls funcs
> django 1424 7023 133 67
>
> static[-1] msec rps tcalls funcs
> django 4972 2011 929 68
>
> static[0] represents tests matching the first URL in the urlconf,
> static[-1] represents tests matching the approximately 100th URL in
> the urlconf.
>
> Cheers
>
> Tom
>
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-developers/-/_U3JOtsVP58J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.