-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faster escape routines #408
base: master
Are you sure you want to change the base?
Conversation
a881c1c
to
af30446
Compare
Figuring out how much of an improvement this is (or even if it is one, on average) might be challenging because I get different results on my AMD based desktop and my Intel based laptop (although laptop benchmarks are inconsistent due to power management). Escaping long inputs is much faster (50-75% faster) on both systems regardless of whether it does any replacements, escaping short inputs on both systems is slower if there are replacements, but my desktop is also slower on short inputs without any replacements whereas my laptop is still faster (just not as much as with the long inputs). Since most attributes are short and don't contain escapable chars, a regression there concerns me a bit. Ironically, these instructions seem to have been added explicitly for the benefit of XML parsing, but they were never widely enough used for hardware manufacturers to prioritize the performance of the instructions, so now it's harder to benefit from them. It also seems like they put more effort into the one that works on null-terminated C strings, and less into the one that looks at strings of an explicit length, which is the variant Rust uses... with the result that it is (apparently) measurably much slower than the one designed for C strings. Frustrating. Supposedly you can get better results with AVX2. Haven't looked into it yet. https://news.ycombinator.com/item?id=14422098 http://lists.xml.org/archives/xml-dev/202108/msg00000.html https://stackoverflow.com/questions/58901232/why-is-sse4-2-cmpstr-slower-than-regular-code |
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #408 +/- ##
==========================================
+ Coverage 64.43% 64.62% +0.19%
==========================================
Files 37 37
Lines 17487 17529 +42
==========================================
+ Hits 11267 11328 +61
+ Misses 6220 6201 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
|
No description provided.