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

Performance Optimization: Replace errmsg with error struct. #122

Merged
merged 4 commits into from Sep 1, 2021
Merged

Conversation

soasme
Copy link
Owner

@soasme soasme commented Sep 1, 2021

Given tables.go,

Before:

$ time ./cli ast --grammar-file ../tests/golang-v1.17.peg --grammar-entry SourceFile ../tables.go > /dev/null

real	0m4.781s
user	0m3.879s
sys	0m0.022s

After:

$ time ./cli ast --grammar-file ../tests/golang-v1.17.peg --grammar-entry SourceFile ../tables.go > /dev/null

real	0m1.253s
user	0m0.843s
sys	0m0.018s

Conclusion:

The change will cut down the execution time by 78%.

@soasme soasme merged commit 2a6e0bc into main Sep 1, 2021
@soasme soasme deleted the err branch September 1, 2021 04:49
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.

None yet

1 participant