Final memory balance:
-1 fat object CompletableFuture
-1 lambda Callable in DelegatingScheduler.schedule
-1 Callable-Runnable wrapper in delayer().schedule (Runnables are wrapped as Callables in FutureTask ctor)
+1 very lean object ScheduledCompletableFuture implements ScheduledFuture, Callable
(not a CompletableFuture anymore)
I am sure this is the final step and one can't optimize this class further.
Not a single unused byte in memory!
This is the continuation of https://github.com/failsafe-lib/failsafe/issues/349
Here: https://github.com/magicprinc/failsafe/commits/leap_of_faith
Final memory balance: -1 fat object
CompletableFuture
-1 lambda Callable inDelegatingScheduler.schedule
-1 Callable-Runnable wrapper indelayer().schedule
(Runnables are wrapped as Callables in FutureTask ctor)+1 very lean object
ScheduledCompletableFuture implements ScheduledFuture, Callable
(not a CompletableFuture anymore)I am sure this is the final step and one can't optimize this class further. Not a single unused byte in memory!