I think I have found your issue, if I'm not wrong, django won't initialize twice if you call it twice (which was your previous behaviour) at least not completely, since apps registry has a "ready" flag. Check this line: https://github.com/django/django/blob/master/django/apps/registry.py#L66
So basically having setup() on top or inside the handler, should yield almost the same results since django won't re load apps that are already loaded, and that's why the change didn't yield any different results. Does the slow down come from somewhere else rather than setup() >From here doing 100 requests these are the results, times are quite higher since I have at least 200ms round trip from here to the USA. min: 0.34s max: 3.58 avg: 0.57s El lunes, 29 de febrero de 2016, 22:21:11 (UTC-3), Rich Jones escribió: > > Hm. This is the downside of cloud services - we cannot look under the hood. > > Since I think that since this is something we _want_ cached, and because > it will make the function being executed shorter in length - it is a good > code decision to make. Thank you for the idea! However, it looks like the > actual result is negligible in terms of round-trip time. > > Maybe you can try with httping and show me your times? Or give > django-zappa a shot yourself! This is the app I'm testing with: > https://github.com/Miserlou/django-helloworld > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/1e45f5b8-e40a-4d97-bc88-d139550426cd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.