Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use busy-looping for rendezvous channels #50

Merged
merged 5 commits into from
Feb 27, 2024
Merged

Conversation

adamw
Copy link
Member

@adamw adamw commented Feb 27, 2024

No description provided.

Copy link

Benchmark results
Java:
(capacity)  (chainLength)  (parallelism)  Mode  Cnt     Score     Error  Units
BufferedBenchmark.arrayBlockingQueue            16            N/A            N/A  avgt    5   150.644 ±  13.651  ns/op
BufferedBenchmark.arrayBlockingQueue           100            N/A            N/A  avgt    5   111.264 ±  17.001  ns/op
BufferedBenchmark.channel                       16            N/A            N/A  avgt    5    85.901 ±   2.878  ns/op
BufferedBenchmark.channel                      100            N/A            N/A  avgt    5    79.505 ±   1.483  ns/op
ChainedBenchmark.channelChain                    0          10000            N/A  avgt    5  1032.052 ±  23.061  ns/op
ChainedBenchmark.channelChain                   16          10000            N/A  avgt    5    29.485 ±   7.614  ns/op
ChainedBenchmark.channelChain                  100          10000            N/A  avgt    5    20.038 ±   2.183  ns/op
ChainedBenchmark.queueChain                      0          10000            N/A  avgt    5   126.384 ±  35.981  ns/op
ChainedBenchmark.queueChain                     16          10000            N/A  avgt    5    16.121 ±   0.711  ns/op
ChainedBenchmark.queueChain                    100          10000            N/A  avgt    5    11.138 ±   0.473  ns/op
ParallelBenchmark.parallelChannels               0            N/A          10000  avgt    5   921.032 ± 154.342  ns/op
ParallelBenchmark.parallelChannels              16            N/A          10000  avgt    5    33.567 ±  10.997  ns/op
ParallelBenchmark.parallelChannels             100            N/A          10000  avgt    5    21.867 ±   3.018  ns/op
ParallelBenchmark.parallelQueues                 0            N/A          10000  avgt    5   106.039 ±  26.579  ns/op
ParallelBenchmark.parallelQueues                16            N/A          10000  avgt    5    22.034 ±   4.260  ns/op
ParallelBenchmark.parallelQueues               100            N/A          10000  avgt    5     8.947 ±   0.848  ns/op
RendezvousBenchmark.channel                    N/A            N/A            N/A  avgt    5   214.342 ±  33.223  ns/op
RendezvousBenchmark.exchanger                  N/A            N/A            N/A  avgt    5    88.532 ±   8.275  ns/op
RendezvousBenchmark.synchronousQueue           N/A            N/A            N/A  avgt    5   553.633 ± 145.880  ns/op
SelectBenchmark.selectWithSingleClause         N/A            N/A            N/A  avgt    5   230.030 ±  47.402  ns/op
SelectBenchmark.selectWithTwoClauses           N/A            N/A            N/A  avgt    5   209.851 ±  14.746  ns/op

Kotlin:
(capacity)  (chainLength)  (parallelism)  Mode  Cnt    Score   Error  Units
BufferedKotlinBenchmark.channel_defaultDispatcher                       16            N/A            N/A  avgt    5   44.076 ± 2.317  ns/op
BufferedKotlinBenchmark.channel_defaultDispatcher                      100            N/A            N/A  avgt    5   32.479 ± 0.404  ns/op
ChainedKotlinBenchmark.channelChain_defaultDispatcher                    0          10000            N/A  avgt    5   57.842 ± 5.115  ns/op
ChainedKotlinBenchmark.channelChain_defaultDispatcher                   16          10000            N/A  avgt    5   18.613 ± 0.383  ns/op
ChainedKotlinBenchmark.channelChain_defaultDispatcher                  100          10000            N/A  avgt    5   16.035 ± 1.050  ns/op
ChainedKotlinBenchmark.channelChain_eventLoop                            0          10000            N/A  avgt    5   94.461 ± 2.543  ns/op
ChainedKotlinBenchmark.channelChain_eventLoop                           16          10000            N/A  avgt    5   34.549 ± 3.144  ns/op
ChainedKotlinBenchmark.channelChain_eventLoop                          100          10000            N/A  avgt    5   31.426 ± 0.091  ns/op
ParallelKotlinBenchmark.parallelChannels_defaultDispatcher               0            N/A          10000  avgt    5  168.069 ± 6.986  ns/op
ParallelKotlinBenchmark.parallelChannels_defaultDispatcher              16            N/A          10000  avgt    5   19.952 ± 0.765  ns/op
ParallelKotlinBenchmark.parallelChannels_defaultDispatcher             100            N/A          10000  avgt    5   15.020 ± 0.203  ns/op
RendezvousKotlinBenchmark.channel_defaultDispatcher                    N/A            N/A            N/A  avgt    5  144.959 ± 0.734  ns/op
SelectKotlinBenchmark.selectWithSingleClause_defaultDispatcher         N/A            N/A            N/A  avgt    5  242.379 ± 1.112  ns/op
SelectKotlinBenchmark.selectWithTwoClauses_defaultDispatcher           N/A            N/A            N/A  avgt    5  346.922 ± 3.079  ns/op

@adamw adamw merged commit 425fec1 into main Feb 27, 2024
1 check passed
@adamw adamw deleted the no_spins_buffered branch February 27, 2024 12:42
Copy link

Benchmark results
Java:
(capacity)  (chainLength)  (parallelism)  Mode  Cnt     Score     Error  Units
BufferedBenchmark.arrayBlockingQueue            16            N/A            N/A  avgt    5   163.943 ±  19.383  ns/op
BufferedBenchmark.arrayBlockingQueue           100            N/A            N/A  avgt    5   115.402 ±   5.101  ns/op
BufferedBenchmark.channel                       16            N/A            N/A  avgt    5    82.492 ±   2.562  ns/op
BufferedBenchmark.channel                      100            N/A            N/A  avgt    5    78.447 ±   5.323  ns/op
ChainedBenchmark.channelChain                    0          10000            N/A  avgt    5  1021.425 ±  20.525  ns/op
ChainedBenchmark.channelChain                   16          10000            N/A  avgt    5    29.464 ±   0.728  ns/op
ChainedBenchmark.channelChain                  100          10000            N/A  avgt    5    19.600 ±   0.665  ns/op
ChainedBenchmark.queueChain                      0          10000            N/A  avgt    5   125.647 ±  46.578  ns/op
ChainedBenchmark.queueChain                     16          10000            N/A  avgt    5    16.831 ±   1.606  ns/op
ChainedBenchmark.queueChain                    100          10000            N/A  avgt    5     9.923 ±   0.178  ns/op
ParallelBenchmark.parallelChannels               0            N/A          10000  avgt    5   917.338 ± 158.440  ns/op
ParallelBenchmark.parallelChannels              16            N/A          10000  avgt    5    36.586 ±   0.193  ns/op
ParallelBenchmark.parallelChannels             100            N/A          10000  avgt    5    22.837 ±   0.119  ns/op
ParallelBenchmark.parallelQueues                 0            N/A          10000  avgt    5   118.829 ±   3.193  ns/op
ParallelBenchmark.parallelQueues                16            N/A          10000  avgt    5    22.790 ±   3.934  ns/op
ParallelBenchmark.parallelQueues               100            N/A          10000  avgt    5     8.727 ±   0.420  ns/op
RendezvousBenchmark.channel                    N/A            N/A            N/A  avgt    5   208.536 ±  24.965  ns/op
RendezvousBenchmark.exchanger                  N/A            N/A            N/A  avgt    5    87.423 ±  10.783  ns/op
RendezvousBenchmark.synchronousQueue           N/A            N/A            N/A  avgt    5   632.112 ± 140.630  ns/op
SelectBenchmark.selectWithSingleClause         N/A            N/A            N/A  avgt    5   237.722 ±  16.677  ns/op
SelectBenchmark.selectWithTwoClauses           N/A            N/A            N/A  avgt    5   223.369 ±  24.623  ns/op

Kotlin:
(capacity)  (chainLength)  (parallelism)  Mode  Cnt    Score    Error  Units
BufferedKotlinBenchmark.channel_defaultDispatcher                       16            N/A            N/A  avgt    5   45.127 ±  0.507  ns/op
BufferedKotlinBenchmark.channel_defaultDispatcher                      100            N/A            N/A  avgt    5   32.644 ±  0.147  ns/op
ChainedKotlinBenchmark.channelChain_defaultDispatcher                    0          10000            N/A  avgt    5   58.474 ±  4.153  ns/op
ChainedKotlinBenchmark.channelChain_defaultDispatcher                   16          10000            N/A  avgt    5   18.168 ±  0.964  ns/op
ChainedKotlinBenchmark.channelChain_defaultDispatcher                  100          10000            N/A  avgt    5   14.685 ±  0.802  ns/op
ChainedKotlinBenchmark.channelChain_eventLoop                            0          10000            N/A  avgt    5   93.733 ±  3.036  ns/op
ChainedKotlinBenchmark.channelChain_eventLoop                           16          10000            N/A  avgt    5   33.949 ±  0.856  ns/op
ChainedKotlinBenchmark.channelChain_eventLoop                          100          10000            N/A  avgt    5   31.524 ±  0.109  ns/op
ParallelKotlinBenchmark.parallelChannels_defaultDispatcher               0            N/A          10000  avgt    5   72.845 ±  5.514  ns/op
ParallelKotlinBenchmark.parallelChannels_defaultDispatcher              16            N/A          10000  avgt    5   21.344 ±  1.609  ns/op
ParallelKotlinBenchmark.parallelChannels_defaultDispatcher             100            N/A          10000  avgt    5   15.517 ±  0.471  ns/op
RendezvousKotlinBenchmark.channel_defaultDispatcher                    N/A            N/A            N/A  avgt    5  141.373 ±  1.958  ns/op
SelectKotlinBenchmark.selectWithSingleClause_defaultDispatcher         N/A            N/A            N/A  avgt    5  237.867 ±  1.519  ns/op
SelectKotlinBenchmark.selectWithTwoClauses_defaultDispatcher           N/A            N/A            N/A  avgt    5  334.052 ± 28.943  ns/op

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant