#3439: django.dispatch.* is grossly slow
--------------------------------------------------+-------------------------
   Reporter:  Brian Harring <[EMAIL PROTECTED]>  |                Owner:  
adrian        
     Status:  new                                 |            Component:  Core 
framework
    Version:  SVN                                 |           Resolution:       
         
   Keywords:                                      |                Stage:  
Accepted      
  Has_patch:  1                                   |           Needs_docs:  0    
         
Needs_tests:  0                                   |   Needs_better_patch:  0    
         
--------------------------------------------------+-------------------------
Comment (by Brian Harring <[EMAIL PROTECTED]>):

 Minor optimization I missed, although it's quadratic worst case
 correction; in _killBackref
 {{{
 while senderkey in receivers_list:
   try:
     receivers_list.remove(senderkey)
   except:
     break
 }}}
 is... certifiably insane.  Utterly.
 
 No idea how I missed that one...
 {{{
 receivers_list = [x for x in receivers_list if senderkey != x]
 }}}
 avoids quadratic worst case for if receivers_list is all senderkey; python
 lists are arrays, popleft forces everything beyond to be moved one to the
 left (worth noting context, and resolve_variable have the same
 whackyness).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3439#comment:3>
Django Code <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 [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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to