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

Optimize the handling of references when consuming data #151

Merged
merged 1 commit into from
Nov 24, 2018

Conversation

stof
Copy link
Contributor

@stof stof commented Nov 24, 2018

The method call to characterReference in all consumeData calls is costly.

Inlining it is quite easy, and allows avoiding reading twice the current token when there is no reference at this point.

Here is the effect on the benchmark included in this repo.

Before:
Loading: 127.32289552689
Writing: 37.346167564392

After:
Loading: 115.40209054947
Writing: 37.080278396606

That's a 9% improvement on the loading time.

@goetas
Copy link
Member

goetas commented Nov 24, 2018

Makes sense. Thanks

@goetas goetas merged commit 855fadd into Masterminds:master Nov 24, 2018
@stof stof deleted the optimize_character_reference branch November 24, 2018 10:45
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