Skip to content
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

Use single value append to avoid the overhead of variable arguments #1936

Merged
merged 1 commit into from
Jan 27, 2018

Conversation

chriswebster
Copy link

Mailing List thread:
https://groups.google.com/forum/#!topic/liftweb/jD3OG9jD_hs

The newValue method in JsonParser was using a variable argument method when adding a single item to a ListBuffer which triggered extra array allocations. This change uses a single item method bypassing the extra array allocation and optimizing performance.

before change
3.2.0-RC1
[info] LiftJsonBenchmark.readCaseClass thrpt 10 443843.164 ± 5996.863 ops/s

After patch
[info] LiftJsonBenchmark.readCaseClass thrpt 10 551319.586 ± 6361.040 ops/s

…ed, instead use += to avoid the variable argument overhead
@Shadowfiend
Copy link
Member

🙇 really appreciate these tweaks you keep contributing @chriswebster !

@farmdawgnation farmdawgnation added this to the 3.3.0-M1 milestone Jan 27, 2018
Copy link
Member

@farmdawgnation farmdawgnation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution!

@farmdawgnation farmdawgnation merged commit 26e18e4 into lift:master Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants