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

Reimplement IO#guaranteeCase and IO.bracketFull #2126

Merged
merged 2 commits into from
Jul 14, 2021
Merged

Reimplement IO#guaranteeCase and IO.bracketFull #2126

merged 2 commits into from
Jul 14, 2021

Conversation

vasilmkd
Copy link
Member

Initially, I was going to say how reimplementing IO#bracketFull in terms of IO#guaranteeCase is clearer and uses less special cased code for guarding user code against misuse of the inherently non-lexical nature of the bracketFull constructor, but it turns out it is both simpler and faster.

series/3.x:

Benchmark               (size)   Mode  Cnt      Score     Error  Units
AsyncBenchmark.bracket     100  thrpt   20  29369.257 ± 492.607  ops/s

This PR:

Benchmark               (size)   Mode  Cnt      Score     Error  Units
AsyncBenchmark.bracket     100  thrpt   20  30321.272 ± 998.223  ops/s

@vasilmkd vasilmkd changed the title Reimplement IO#guaranteeCase and IO#bracketFull Reimplement IO#guaranteeCase and IO.bracketFull Jul 13, 2021
@djspiewak
Copy link
Member

Fascinating!

@djspiewak djspiewak merged commit e7eb2ad into typelevel:series/3.x Jul 14, 2021
@vasilmkd vasilmkd deleted the inherit-guarantee branch July 14, 2021 16:28
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.

2 participants