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

Second Batch of Optimizations — IO.apply #91

Merged
merged 2 commits into from
Dec 5, 2017

Conversation

alexandru
Copy link
Member

@alexandru alexandru commented Dec 3, 2017

Continuing the work started in PR #90, this pull request optimizes IO.apply.

We do so by introducing a special internal state just for it. This is worth it in terms of performance because it avoids extraneous memory allocations and the numbers look good.

Also the loops described in IORunLoop are now no longer described as @tailrec functions, but as while loops. This led to a slight improvement across the board and it's important because it afforded us the IO.apply optimization in its current form.

Here's the numbers and note that version 0.6-964e8d0 here is PR #90:

Benchmark 0.5 0.6-964e8d0 This PR
ShallowBindBenchmark.async 48.609 83.134 87.018
ShallowBindBenchmark.delay 1535.69 3643.028 5452.494
ShallowBindBenchmark.pure 2556.71 6293.489 6512.625
DeepBindBenchmark.async 2.728 340.461 370.715
DeepBindBenchmark.delay 4.401 5442.471 6469.298
DeepBindBenchmark.pure 2790.456 7133.611 7437.164
AttemptBenchmark.errorRaised 4.265 2122.419 2336.17
AttemptBenchmark.happyPath 111.192 2273.447 2479.291
HandleErrorBenchmark.errorRaised 283.353 1934.246 1987.989
HandleErrorBenchmark.happyPath 1120.249 3058.098 3044.987

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.

3 participants