-
Notifications
You must be signed in to change notification settings - Fork 472
Performance improvements in TemplateVariable.essence()
#1764
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
Noticed this took a relatively large portion of time when Unit tests of LinkBuilding (via Integration testing and Testing Controller layer), due to String format needing to parse the format string for each template variable
Nice one! Do you have any numbers hand pre and post optimization? |
Thanks. I took a few extra steps to remove all usage of
to this:
which is almost a 4x improvement. Pushes coming in a minute. |
TemplateVariable.essence()
Fantastic! Thank you! |
Heavily inspired by the PR @MikeRocke, we removed all usage of String.format(…) from hot code paths triggered by ….toString() as it's used in general output a lot. Before: Benchmark Mode Cnt Score Error Units TemplateVariableBenchmark.toString(…) thrpt 3 2803239,270 ± 110258,955 ops/s After: Benchmark Mode Cnt Score Error Units TemplateVariableBenchmark.toString(…) thrpt 3 10753653,459 ± 156684,459 ops/s
Backported until 1.4.x. Feel free to give the snapshots a try. |
Just an update, quick experiment of v1.4.1 against 1.4.2-SNAPSHOT in one of our app build, test phase went from 800s to 534s. I know I should repeat the experiments to get a good statistical figure but overall, looks like a win! Super thank you @odrotbohm |
Noticed this took a relatively large portion of time when Unit tests of LinkBuilding (via Integration testing and Testing Controller layer), due to String format needing to parse the format string for each template variable
Minor spell corrections on test methods when spotted