#11198: Forms URLfield regex takes infinite to validate a long field
------------------------------------+---------------------------------------
          Reporter:  marcob         |         Owner:  nobody
            Status:  closed         |     Milestone:        
         Component:  Uncategorized  |       Version:  SVN   
        Resolution:  worksforme     |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Changes (by Alex):

  * status:  new => closed
  * needs_better_patch:  => 0
  * resolution:  => worksforme
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 I'm unable to reproduce:
 {{{
 >>> %time url_re.search("http:///asdasdas.asdsa.sadasdsa";)
 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
 Wall time: 0.00 s

 >>> %timeit url_re.search("http:///asdasdas.asdsa.sadasdsa";)
 1000000 loops, best of 3: 1.54 µs per loop

 >>> %timeit
 url_re.search("http:///asdasdas.asdsa.sadasdsa.adssadsa.dsadsadsadsa.sadsa";)
 100000 loops, best of 3: 2.18 µs per loop

 >>> %timeit
 
url_re.search("http:///asdasdas.asdsa.sadasdsa.adssadsa.dsadsadsadsa.sadsa.dsadffgdsaf.fdsafadsfwq.fdsafdsafas";)
 100000 loops, best of 3: 2.93 µs per loop

 >>> %timeit
 
url_re.search("http:///asdasdas.asdsa.sadasdsa.adssadsa.dsadsadsadsa.sadsa.dsadffgdsaf.fdsafadsfwq.fdsafdsafas.fdafdsafdafdsa.fdsafdsafsafdsafsa.gwretewfewqfewqewfdsfdaf";)
 100000 loops, best of 3: 4.04 µs per loop
 }}}

 In any event this wouldn't be a django bug, it would be one with the
 python reguar expression parser/bytecode interpreter.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11198#comment:1>
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 [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