Skip to content

Commit

Permalink
Add timeSetFutures_Normal benchmark; update OldAbstractFuture
Browse files Browse the repository at this point in the history
AbstractFutureBenchmarks "old" impl changed to match the "current" impl
(pre setFuture optimizations)
  • Loading branch information
njhill committed Jan 29, 2019
1 parent cf5d017 commit adafd98
Show file tree
Hide file tree
Showing 2 changed files with 1,328 additions and 268 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ public long timeComplete_Normal(int reps) throws Exception {
return r;
}

@Benchmark
public boolean timeSetFutures_Normal(int reps) {
Facade<String> orig = impl.newFacade(), prev = orig;
for (int i = 0; i < reps; i++) {
Facade<String> curr = impl.newFacade();
prev.setFuture(curr);
prev = curr;
}
prev.set("done"); // prev represents the 'innermost' future
return orig.isDone();
}

@Benchmark
public long timeComplete_Failure(int reps) throws Exception {
long r = 0;
Expand Down
Loading

0 comments on commit adafd98

Please sign in to comment.