On Wed, Oct 10, 2012 at 7:52 AM, Moonlight <moonlight_13_...@yahoo.com> wrote: > Here is an article comparing various URL dispatchers: > > http://mindref.blogspot.com/2012/10/python-web-routing-benchmark.html > > What cause django URL dispatcher that much... slow? >
Now that I've looked in detail at the test, it is because the test is nonsensical. Each time it tests the URLs, it constructs a fresh WSGI application. Each fresh application has to compile each URL in the urlconf before using it. It then destroys the application, and starts another one up. In a normal django application, you do not start from fresh on each request. This explains why the performance degradation from "static[0]" to "static[-1] " - which is the difference between testing the first url in the urlconf and the last url in the urlconf - is so pathological, each time it is run Django is recompiling each and every URL regexp in the urlconf (as well as _all_ other work django does at server start). This is testing something, but it is not testing django as a web application, or as Django is intended to be run. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.