Improve performance of query string parsing#1493
Conversation
When looking at the performance regression in #1492, I noticed that much of the time was spent in parse_qsl, however we do not need all the complexity of parse_sql since we use a very limited subset of the functionality. We can write a faster version using the unquoter built-in to yarl with very little code.
CodSpeed Performance ReportMerging #1493 will improve performances by 29.13%Comparing Summary
Benchmarks breakdown
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1493 +/- ##
=======================================
Coverage 98.92% 98.92%
=======================================
Files 32 32
Lines 6055 6070 +15
Branches 363 365 +2
=======================================
+ Hits 5990 6005 +15
Misses 62 62
Partials 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Good idea! |
We are down to very few urllib.parse calls left. The one in Line 32 in f73f47e urllib.parse.quote. However I don't expect human_quote is called frequently so I haven't tried to optimize it so much.
|
What do these changes do?
When looking at the performance regression in #1492, I noticed that much of the time was spent in
parse_qsl, however we do not need all the complexity ofparse_sqlsince we use a very limited subset of the functionality.We can write a faster version using the unquoter built-in to yarl with very little code.
Are there changes in behavior for the user?
no
Related issue number
n/a
Checklist