-
Notifications
You must be signed in to change notification settings - Fork 17
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
Regexp mem opt #119
base: master
Are you sure you want to change the base?
Regexp mem opt #119
Conversation
✅ Deploy Preview for raredocs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #119 +/- ##
==========================================
- Coverage 92.53% 92.35% -0.19%
==========================================
Files 120 122 +2
Lines 6255 6315 +60
==========================================
+ Hits 5788 5832 +44
- Misses 346 359 +13
- Partials 121 124 +3 ☔ View full report in Codecov by Sentry. |
@@ -7,6 +7,7 @@ type Factory interface { | |||
|
|||
// A non-thread-safe matcher that can be used to find matches | |||
type Matcher interface { | |||
FindSubmatchIndex(b []byte) []int | |||
FindSubmatchIndexDst(b []byte, dst []int) []int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs
Optimize all matchers into zero-allocs by using passed-in buffer
I've been doing a ton of benchmarking on this, and while it does save some allocs, it actually seems to increase frozen GC time and net-neutral on general runtime. Benchmarks on a regex itself does have significant savings, so it does seem counter-intuitive.
There's more to figure out here before/if merging.