#16902: select_related() results in a poor perfomance -------------------------------------+------------------------------------- Reporter: ivan_virabyan | Owner: nobody Type: | Status: new Cleanup/optimization | Version: SVN Component: Database layer | Resolution: (models, ORM) | Triage Stage: Accepted Severity: Normal | Needs documentation: 0 Keywords: select_related, | Patch needs improvement: 0 get_cached_row, perfomance | UI/UX: 0 Has patch: 1 | Needs tests: 0 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by ivan_virabyan): You have an error in djangobench/benchmarks/query_select_related/fixtures/initial_data.json So, fixtures are not loaded (I assume django fails silently on that). You can see it if you try {{{ Book.objects.all()[0] }}} inside of the benchmark. IndexError will be raised. I filled initial_data.json with the right data, and now benchmark does work properly: {{{ Running benchmarks: query_select_related Control: Django 1.3 SVN-16926 (in django-control) Experiment: Django 1.4 pre-alpha SVN-16926 (in django-experiment) Running 'query_select_related' benchmark ... Min: 0.196191 -> 0.088349: 2.2206x faster Avg: 0.199001 -> 0.090405: 2.2012x faster Significant (t=120.254008) Stddev: 0.00497 -> 0.00400: 1.2426x smaller (N = 50) }}} Here is the fixed fork: https://github.com/ivirabyan/djangobench/ -- Ticket URL: <https://code.djangoproject.com/ticket/16902#comment:4> Django <https://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-updates@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.