Closed Simulant87 closed 2 days ago
Appreciate the effort, but no, thanks. Improved performance is not itself a compelling reason to modify the code.
I am sad to hear that and in the end I will accept your decision and not submit any further PRs for it, but please hear me out: I totally understand if there is currently no time to review it. But maybe you can give it a try later on.
I know that simplicity is one of the core values of this project, and therefore the default decision is the reject unnecessary changes. But also a performant implementation is one of the main goals, which this change continues to. There are many other projects depending on this library, which I assume would be happy to have this improvement integrated. As this part of the code is heavily called internally, it is not possible to use this change as an external extension. My implementation is straight forward to review and you accepted other performance improvements as well. I would be very happy if you rethink your initial decision maybe later on.
I implemented a CharSequenceReader from scratch, which is noticable faster in parsing a String input than the current default implementation.
performance test implementation below.
Measurement on master branch: I disabled my CPU turbo boost, to have a better comparison and less variance between the runs. Also with turbo boost enabled the results are comparable, just faster and with more variance.
435ms per parsing on average.
Measurement on improved branch:
354ms per parsing on average.
--> 18% performance improvement.