-
Notifications
You must be signed in to change notification settings - Fork 295
CA-421084: xstringext: Improve performance of escaped #6767
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
Conversation
Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
edwintorok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that the map_unlikely function works correctly, this looks good.
If we want to be sure could add a quickcheck test with a copy of the old implementation and new implementations and have it try to find differences in behaviour.
There are examples of QCheck2 usage in XAPI already
|
Are there any mini benchmarks to see the improvement? I have a wip branch with more cleanup around strings, especially consolidating escaping functions, which might be a worthwile thing to revise while you're on the area. Unfortunately I don't have much time to test the changes, which is why I haven't opened a PR. master...psafont:xen-api:dev/pau/strings The series removes map_unlikely, and changes escaped. That needs to be changed to work well with your change, of course |
|
I'm happy to produce some benchmarks with the tests. I'll also take a look at the branch you've linked, thank you, though I'll focus on getting this change through for now. |
Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
|
Benchmarking against a naive implementation gives: |
|
It would be good to have a unified benchmark markup library within xapi, rather than reproducing bechamel_simple_cli.ml whenever a benchmark is needed |
|
I would expect an improvement that is not visible in the benchmark: this creates much less memory garbage and that improvement will not show up in the benchmark, I would assume. |
f639e06 to
4d57100
Compare
Signed-off-by: Christian Pardillo Laursen <christian.pardillolaursen@citrix.com>
4d57100 to
8e2b9d8
Compare
Updated implementation to use map_unlikely, which is optimised for this sort of thing.