mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
A sloppy implementation of the main has_request_variables wrapper function meant that it did two very inefficient things: * To combine together the GET and POST parameters, it would make a copy of the request.GET QueryDict object, which combined with the fact that these objects are slow to access, consumed about 90us per argument. * Doing this in a loop (one time per argument), rather than once, which resulted in us doing this 11 times for a `GET /events` query. Fixing this to just make a dictionary and combine things with some small loops saved about 1 millisecond from the total runtime of GET /events (for comparison, the total actual work of that view function is about 700ms). We need to fix at least one test that used a bad mock HttpRequest object that didn't have a .GET property.
13 KiB
13 KiB