-
Couldn't load subscription status.
- Fork 1.4k
Boost TMap performance #3382
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
Boost TMap performance #3382
Conversation
This reverts commit ad4ca64.
| val length = in.length | ||
| var idx = 0 | ||
|
|
||
| var tx: ZSTM[R, E, ChunkBuilder[B]] = ZSTM.succeedNow(ChunkBuilder.make[B]) |
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.
We're allocating memory in a pure function, which is a no-no. So we have to make sure this is suspended in STM. I'd add a top-level STM wrapper (new STM) to make sure this function becomes referentially transparent.
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.
Fixed via ZSTM.suspend.
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.
Phenomenal work! Just one minor change and then after the tests pass, will be good to merge!
|
🎉 🕺 |
Summary
Benchmark results
Baseline
After changes
Further steps
TRefvsTMap. This PR significantly improves numbers forTMap, but I still suspect these are a bit misleading, and I'd like to spend some time on that benchmark.