Skip to content
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

Apply minor optimizations to StringCharStream and JS BitSet #171

Merged
merged 4 commits into from
Feb 8, 2024

Conversation

lppedd
Copy link
Contributor

@lppedd lppedd commented Feb 6, 2024

The optimizations done for StringCharStream reduce up to half the time spent indexing code points in very large strings.

I've tested it with 4+ megabytes text files.

@lppedd lppedd force-pushed the refactor/mem-alloc branch 3 times, most recently from 1ba60d4 to ae359e8 Compare February 6, 2024 20:12
@lppedd
Copy link
Contributor Author

lppedd commented Feb 6, 2024

@ftomassetti the code looks "worse" than before, but the benefits are pretty amazing for StringCharStream.

On my laptop - with a 4 megabytes file - I get:

Target Before After
JVM 11.529621 ms 4.075896 ms
JS 41.52782 ms 25.09781 ms
WASM 109.095989 ms 40.703107 ms
mingwX64 19.490488 ms 8.587009 ms

Ken mentioned performance in the email, and I think we have a lot of room for improvement.
Many micro-optimizations summed together might give us quite a boost.

@ftomassetti
Copy link
Member

Added a few minor comments

@ftomassetti
Copy link
Member

Thank you @lppedd

@ftomassetti ftomassetti merged commit 584ffd8 into Strumenta:master Feb 8, 2024
6 checks passed
@lppedd lppedd deleted the refactor/mem-alloc branch February 8, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants