FindSubstring<&[u8]>: make use of memchr::memmem#1375
FindSubstring<&[u8]>: make use of memchr::memmem#1375homersimpsons wants to merge 2 commits intorust-bakery:mainfrom
memchr::memmem#1375Conversation
a33987b to
129ce0a
Compare
|
Note: I just force-pushed to retry CI, I could not rerun as "[the] workflow file may be broken." |
129ce0a to
3de6704
Compare
|
At this point I'm wondering if using memchr is still the right approach, considering that a lot of parsers looking for a specific token or substring work on very small inputs. Maybe we should compare with a naive implementation |
|
My findings are
winnow took the approach of putting Recently, I've been working with Byron on porting gitoxide from nom to winnow (GitoxideLabs/gitoxide#956). Within gitoxide, the use of |
|
Important to note that for gitoxide,
So its a mix of single-character (the |
|
substring search and single character matching could work better as different combinators, they are not meant for the same task, and usually don't happen on the same amount of data. Thank you for taking the time to measure this on a larger codebase |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1375 +/- ##
=======================================
Coverage 61.47% 61.47%
=======================================
Files 24 24
Lines 2951 2936 -15
=======================================
- Hits 1814 1805 -9
+ Misses 1137 1131 -6 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #1375 will not alter performanceComparing Summary
|
I guess that #565 could be closed with this one.
memchrMSRV is rust 1.41.1 so it should be okay.FTR I did run criterion before and after the change