-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Removed Algebra.Release #1417
Removed Algebra.Release #1417
Conversation
I agree with the underlying idea. Will review more thoroughly once I get home. |
@mpilquist thats cool. Exactly what was needed to simplify it. Will review over weekend. |
BTW, I'll look in to the TCP test failure soon -- some time in next couple of days. |
@mpilquist is there any common structure to the cases where you had to introduce |
Yeah, I'll try to characterize them. There were a couple of cases -- the one in the implementation of Why only these few cases though? I believe that's b/c these are cases where the |
ah ok, that's what I wasn't sure about actually, thanks :) |
Prior to this PR, resources were released in two main ways:
Algebra.Release
would release a specific resourceAlgebra.CloseScope
would close a scope, releasing all resources in that scope (and child scopes)While working on the topic/tagless2 branch, I noticed that we hardly ever hit case (1) above. Almost all resources get released as a result of (2). I added instrumentation to the interpreter to track those conditions and ran our test suite with these results:
Prior to this PR, over 96% of all release releases were due to scope closure.
In this PR, I removed the
Algebra.Release
constructor and changedStream.bracket
to no longer explicitly release the acquired resource. This brokemerge
due to an assumption on when a finalizer would be run, but that was easily fixed by explicit introduction of a scope (see the diff). Otherwise, all tests passed.My motivations:
Release
node on everybracket
which is typically not used.