Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Issue 1516783003: Make chained futures point to their source instead of opposite. (Closed)

Created:
5 years ago by Lasse Reichstein Nielsen
Modified:
5 years ago
Reviewers:
floitsch, sra1
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Make chained futures point to their source instead of opposite. This means that a chained future that nobody cares about will not be kept alive by the source. Any listeners added to the chained future is forwarded to the source. If the chained source notices that the source has completed, it copies the values and drops the link completely. This should allow some unused futures to be GC'ed earlier than otherwise. R=floitsch@google.com Committed: https://github.com/dart-lang/sdk/commit/ed0bc4315832315c76651e33cf02da2a0c5e713d

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -47 lines) Patch
M sdk/lib/async/future_impl.dart View 1 15 chunks +102 lines, -47 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Lasse Reichstein Nielsen
5 years ago (2015-12-11 06:53:19 UTC) #2
floitsch
LGTM! https://codereview.chromium.org/1516783003/diff/1/sdk/lib/async/future_impl.dart File sdk/lib/async/future_impl.dart (right): https://codereview.chromium.org/1516783003/diff/1/sdk/lib/async/future_impl.dart#newcode181 sdk/lib/async/future_impl.dart:181: bool get _mayAddListener => _state <= _PENDING_COMPLETE; I ...
5 years ago (2015-12-11 09:02:10 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #2 (id:20001) manually as ed0bc4315832315c76651e33cf02da2a0c5e713d (presubmit successful).
5 years ago (2015-12-11 10:13:53 UTC) #5
floitsch
Please send out your comments.
5 years ago (2015-12-11 18:43:43 UTC) #6
sra1
Can we make the code smaller? This adds 2k to swarm which afaik does not ...
5 years ago (2015-12-11 19:19:47 UTC) #8
Lasse Reichstein Nielsen
https://codereview.chromium.org/1516783003/diff/1/sdk/lib/async/future_impl.dart File sdk/lib/async/future_impl.dart (right): https://codereview.chromium.org/1516783003/diff/1/sdk/lib/async/future_impl.dart#newcode181 sdk/lib/async/future_impl.dart:181: bool get _mayAddListener => _state <= _PENDING_COMPLETE; The body ...
5 years ago (2015-12-11 22:51:34 UTC) #9
Lasse Reichstein Nielsen
On 2015/12/11 19:19:47, sra1 wrote: > Can we make the code smaller? This adds 2k ...
5 years ago (2015-12-11 22:52:19 UTC) #10
floitsch
On 2015/12/11 22:52:19, Lasse Reichstein Nielsen wrote: > On 2015/12/11 19:19:47, sra1 wrote: > > ...
5 years ago (2015-12-11 22:56:58 UTC) #11
Lasse Reichstein Nielsen
5 years ago (2015-12-11 23:18:46 UTC) #12
Message was sent while issue was closed.
On 2015/12/11 22:52:19, Lasse Reichstein Nielsen wrote:
> On 2015/12/11 19:19:47, sra1 wrote:
> > Can we make the code smaller? This adds 2k to swarm which afaik does not use
> > chained futures.
> 
> I have an idea that might drop the "_prependListeners" function. I can try
that.

Florian might be right that this is not the source of the increase, but try
checking if https://codereview.chromium.org/1524533002 makes a difference for
Swarm.

Powered by Google App Engine
This is Rietveld 408576698