-
Notifications
You must be signed in to change notification settings - Fork 23
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
pre-compile regexp2 with regexp2cg #11
Conversation
I was looking for something like this a while ago. Will test and give you feedback. Thanks! |
Hey, I can't get the regeneration to work, can you tell me what command did you execute to regenerate the code? Ideally would like to make a comment in some file
|
Please check my PR on the tools repo and you have to use my modifications on this repo to get it to work. It doesn't work with MustCompile being inside a struct declaration. |
I checked out this pr so the regexps are on a separate variable. what's your PR on the tools repo? |
I just ran it inside |
Ahh, got it! I'd like your PR on regexp2cg to be merged first before approving this PR. Before switching the Regexp Engine I'd like to make sure this library will be maintained. That said, I'll try to nudge your PR to dlclrak/regexp2. Thanks for your patience. |
Understandable! No rush, just nice to see performance improvements like this are possible. |
@bluescreen10 just a small bump, dlclark/regexp2cg#2 has been merged |
Yes saw that, I'll re-test and merge. Sorry it is taking me a little bit of time. |
I unfortunately, even though it was merged, it wasn't released yet. I've created an issue to track that |
@bluescreen10 how to get it without official release? how to build the lib? does it also improve memory usage? |
f307e8d
to
2e19c14
Compare
I noticed that https://github.com/dlclark/regexp2cg was available which can pre-compile the regular expressions used in this library. Based on the benchmarks (Macbook Pro M2) it seems to give around 2x improvement.
The tooling
regexp2cg
has some quirks in case the library gets more encoding in the future, but maybe this causes more interest and the project to be be picked up more.I reorganized the tests so I could re-use the data for the benchmarks.