This repository has been archived by the owner. It is now read-only.

Performance issue : to many get_template() #103

Closed
edouard-gv opened this Issue Sep 10, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@edouard-gv

edouard-gv commented Sep 10, 2013

First of all, thank you for this tremendous module, I can't wait its adaptation to bootstrap3.

Nevertheless, there seem to have a quite big performance issue, due to, imho, to many template recursive calls.

Dis any one face this issue ? Do you have any idea how to rework a bit this module ?

Usage : I have 3 forms containing each 5 to 6 fields, on each of which I apply the bootstrap filter (I can't apply it to the form on the whole for I have to make some specific adaptations to some fields).

Results : using django-bootstrap-tookit multiply by 3 the time of rendering, lazy database requests included. I did suspect database requests but I evinced this hypothesis by removing their calls.

Details, using django-profiler on django response render function, greping template and bootstrap calls.
With bootstrap calls on each fields:

django.template.response.render took: 5273.272991 ms, executed 462 queries in 0.036000 seconds
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     7268    0.015    0.000    1.016    0.000 app_directories.py:38(get_template_sources)
       23    0.003    0.000    4.241    0.184 bootstrap_toolkit.py:84(as_bootstrap)
     2908    0.007    0.000    0.260    0.000 filesystem.py:13(get_template_sources)
  1454/24    0.006    0.000    3.821    0.159 loader.py:141(get_template)
  1454/24    0.003    0.000    3.795    0.158 loader.py:152(get_template_from_string)

With no bootstrap call:

django.template.response.render took: 1391.469002 ms, executed 462 queries in 0.040000 seconds
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        8    0.000    0.000    0.001    0.000 app_directories.py:38(get_template_sources)
        4    0.000    0.000    0.000    0.000 filesystem.py:13(get_template_sources)
        2    0.000    0.000    0.015    0.007 loader.py:141(get_template)
        2    0.000    0.000    0.013    0.007 loader.py:152(get_template_from_string)
@dyve

This comment has been minimized.

Show comment
Hide comment
@dyve

dyve Sep 11, 2013

Owner

This is why I took a different approach in django-bootstrap3. The templates are great for customization, but not for performance. Once django-bootstrap3 is steady, I may backport the whole thing to django-bootstrap-toolkit.

Owner

dyve commented Sep 11, 2013

This is why I took a different approach in django-bootstrap3. The templates are great for customization, but not for performance. Once django-bootstrap3 is steady, I may backport the whole thing to django-bootstrap-toolkit.

@dyve dyve closed this Jan 20, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.