Fork me on GitHub
#funcool
<
2019-09-16
>
niwinz13:09:43

user=> (bench (simple-promise-chain-5))
amd64 Linux 5.2.9-arch1-1-ARCH 4 cpu(s)
OpenJDK 64-Bit Server VM 25.222-b05
Runtime arguments: -Dclojure.libfile=.cpcache/1379323951.libs
Evaluation count : 2330934 in 6 samples of 388489 calls.
      Execution time sample mean : 259.714484 ns
             Execution time mean : 259.613452 ns
Execution time sample std-deviation : 5.530111 ns
    Execution time std-deviation : 5.542603 ns
   Execution time lower quantile : 253.789804 ns ( 2.5%)
   Execution time upper quantile : 267.680303 ns (97.5%)
                   Overhead used : 1.535496 ns

user=> (bench (simple-completable-chain-5))
amd64 Linux 5.2.9-arch1-1-ARCH 4 cpu(s)
OpenJDK 64-Bit Server VM 25.222-b05
Runtime arguments: -Dclojure.libfile=.cpcache/1379323951.libs
Evaluation count : 1832040 in 6 samples of 305340 calls.
      Execution time sample mean : 265.049308 ns
             Execution time mean : 265.009442 ns
Execution time sample std-deviation : 3.174583 ns
    Execution time std-deviation : 3.400731 ns
   Execution time lower quantile : 261.017905 ns ( 2.5%)
   Execution time upper quantile : 268.803217 ns (97.5%)
                   Overhead used : 1.535496 ns

niwinz13:09:04

user=> (bench' (simple-promise-chain-5-raw))
Evaluation count : 4422288 in 6 samples of 737048 calls.
             Execution time mean : 137.411151 ns
    Execution time std-deviation : 1.440472 ns
   Execution time lower quantile : 135.616210 ns ( 2.5%)
   Execution time upper quantile : 139.088517 ns (97.5%)
                   Overhead used : 1.535496 ns
nil
user=> (bench' (simple-completable-chain-5-raw))
Evaluation count : 4780212 in 6 samples of 796702 calls.
             Execution time mean : 128.531062 ns
    Execution time std-deviation : 4.282302 ns
   Execution time lower quantile : 125.348313 ns ( 2.5%)
   Execution time upper quantile : 134.078223 ns (97.5%)
                   Overhead used : 1.535496 ns
nil

niwinz13:09:13

This one using plain then' without any sugaring (no realistic example, but show the real "overhead" of protocols and additional function calls)

mpenet15:09:43

yeah they both are quite similar, there are not millions of ways to wrap this stuff I guess. But while they are similar they differ in a few ways from what I saw when @ikitommi reminded me about promesa: no dyn vars, smaller api surface and I need manifold api compatibility (potentially, not using auspex in the real world for now), since our codebase is manifold heavy. But as @ikitommi said to me, in the end it's all completablefutures & co, so interoperable

mpenet15:09:45

(replying to @niwinz private msg here, felt relevant)

mpenet15:09:32

but before I consider using these I need a manifold/stream replacement, which is something I am considering/working-on atm (in spare/commute time)

niwinz17:09:51

@mpenet thanks for the answer, but with the lastest changes on the 4.0.0 there are very small differences i think.., and the missing api can be implemented... But on the end, you are right, they interoperate, I was just wondering if there are some colaboration 😊