-
Notifications
You must be signed in to change notification settings - Fork 212
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
Refactor date detection in lexer #440
Labels
performance
Issue related to a performance problem or pull request improving performance.
Comments
Totally right, that needs to go. I was lazy when I put that in back then, now it's biting us in the back. Sorry 😬 |
pelletier
added
the
performance
Issue related to a performance problem or pull request improving performance.
label
Sep 12, 2020
As an additional side-effect, factoring out the regexp would get rid of |
Merged
pelletier
added a commit
that referenced
this issue
Oct 11, 2020
Fixes #440. ``` benchmark old ns/op new ns/op delta BenchmarkUnmarshalToml-8 269582 257032 -4.66% benchmark old allocs new allocs delta BenchmarkUnmarshalToml-8 2650 2650 +0.00% benchmark old bytes new bytes delta BenchmarkUnmarshalToml-8 127761 127030 -0.57% ```
With the two patches:
|
Merged
pelletier
added a commit
that referenced
this issue
Oct 11, 2020
* Remove underscore regexps Fixes #440. ``` benchmark old ns/op new ns/op delta BenchmarkUnmarshalToml-8 269582 257032 -4.66% benchmark old allocs new allocs delta BenchmarkUnmarshalToml-8 2650 2650 +0.00% benchmark old bytes new bytes delta BenchmarkUnmarshalToml-8 127761 127030 -0.57% ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Issue
As of 5c94d86, 18-20% of memory consumption is occurring inside of the
dateRegexp
matching inlexRvalue
when unmarshalling thebenchmark.toml
doc. There are very few dates in the TOML document.To Reproduce
Run the unmarshal happening in
BenchmarkUnmarshalToml
once with pprof profiling enabled. Here's the jist of it:Expected Behavior
No regular expressions in the lexer. Better memory performance.
Versions
Additional Context
Part of the issue may be that the regexp is executed every time a number or date is expected.
Related to #167
The text was updated successfully, but these errors were encountered: