#14365: Make template-rendering signals available also in DEBUG mode
----------------------------------------+-----------------------------------
          Reporter:  carljm             |         Owner:  carljm
            Status:  new                |     Milestone:        
         Component:  Testing framework  |       Version:  SVN   
        Resolution:                     |      Keywords:        
             Stage:  Accepted           |     Has_patch:  1     
        Needs_docs:  0                  |   Needs_tests:  0     
Needs_better_patch:  0                  |  
----------------------------------------+-----------------------------------
Changes (by carljm):

  * owner:  nobody => carljm
  * has_patch:  0 => 1

Comment:

 Here's my initial go at a patch. It bases the sending of the signal on the
 value of TEMPLATE_DEBUG, and setup_test_environment forces the sending of
 the signal regardless.

 As you can see, this patch does a boolean if check on every template
 render. This is the simplest, most straightforward code, so I decided to
 try it first and check the performance impact. I added a
 template_render_simple benchmark to djangobench (available at
 http://github.com/carljm/djangobench/tree/template_render_simple) to focus
 on the render call itself and eliminate as much noise as possible. Results
 also attached: djangobench certainly isn't detecting any noticeable
 slowdown; half the time it seems to think it's faster, which suggests to
 me that any impact is so small as to be completely insignificant.

 If someone can detect a statistically significant slowdown from this
 change, or suggest any alternative benchmarking methods that might detect
 one, I have ideas for how the boolean check could be done just once at
 import time. But all of these ideas would involve less readable and
 maintainable code, so I'm going to vote for the simple approach in the
 absence of any evidence of a performance issue.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14365#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to