![]() took 23.32 s, total 56 iterationsīenchmarked simple replacement/pcre-heavyīenchmarking simple replacement/lens-regex-pcre. took 97.26 s, total 56 iterationsīenchmarked complex pattern search/lens-regex-pcreīenchmarking simple replacement/pcre-heavy. took 95.95 s, total 56 iterationsīenchmarked complex pattern search/pcre-heavyīenchmarking complex pattern search/lens-regex-pcre. took 20.79 s, total 56 iterationsīenchmarked static pattern search/lens-regex-pcreīenchmarking complex pattern search/pcre-heavy. took 20.78 s, total 56 iterationsīenchmarked static pattern search/pcre-heavyīenchmarking static pattern search/lens-regex-pcre. ![]() Here are the benchmarks on my 2013 Macbook (2.6 Ghz i5) benchmarking static pattern search/pcre-heavy. Without pcre-light and pcre-heavy this library wouldn’t be possible, so huge thanks to all contributors! I’m neither a benchmarks nor stats person, so please open an issue if anything here seems fishy. I suspect that pcre-heavy can benefit from the same optimization if anyone feels like back-porting it it could be (almost) as nicely using simple traverse without any lenses. It was easy enough, so I went ahead and made the whole thing use ByteString Builders, which sped it up a lot. This means it’s pretty easy to make edits, and is also the reason we can support arbitrary traversals/actions. The nature of this implementation makes it a lot easier to understand than imperative implementations of the same thing. After that it splits the text into chunks and traverses over them with whichever operation you’ve chosen. ![]() How can it possibly be faster if it’s based on pcre-heavy? lens-regex-pcre only uses pcre-heavy for finding the matches, not substitution/replacement.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |