#12581: connection.queries should use a ring buffer to avoid large memory consumption under runserver -------------------------------------+------------------------------------- Reporter: robhudson | Owner: nobody Type: | Status: new Cleanup/optimization | Version: master Component: Database layer | Resolution: (models, ORM) | Triage Stage: Accepted Severity: Normal | Needs documentation: 0 Keywords: | Patch needs improvement: 0 Has patch: 1 | UI/UX: 0 Needs tests: 1 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by bmispelon): I had to tweak `django.test.utils.CapturedQueriesContext` in order to get the test suite to run but after that, all the tests pass without further modification. I also took a closer look at how this affects DDT and it really seems to run without any problem. It's not actually affected by the change since it has its own logic for counting queries (I tried setting the `maxlen` to 1 and DDT would still show the correct number of queries). One thing I'm concerned about is hardcoding this `maxlen` value to 100, but I don't know how to do it in a more flexible manner (creating another setting is likely out of question). I'll look into adding some tests and maybe some documentation in the upcoming days. -- Ticket URL: <https://code.djangoproject.com/ticket/12581#comment:12> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.