softwaremill / jox

Fast and Scalable Channels in Java
Apache License 2.0
251 stars 8 forks source link

Implement isClosedForSend / isClosedForReceive #42

Closed adamw closed 9 months ago

adamw commented 9 months ago

Closes #39

github-actions[bot] commented 9 months ago
Benchmark results ``` Java: (capacity) (chainLength) Mode Cnt Score Error Units BufferedBenchmark.arrayBlockingQueue 1 N/A avgt 5 993.681 ± 89.395 ns/op BufferedBenchmark.arrayBlockingQueue 10 N/A avgt 5 192.077 ± 55.232 ns/op BufferedBenchmark.arrayBlockingQueue 100 N/A avgt 5 128.445 ± 3.596 ns/op BufferedBenchmark.channel 1 N/A avgt 5 208.053 ± 60.333 ns/op BufferedBenchmark.channel 10 N/A avgt 5 187.914 ± 36.481 ns/op BufferedBenchmark.channel 100 N/A avgt 5 156.527 ± 23.434 ns/op ChainedBenchmark.channelChain 0 100 avgt 5 1011.684 ± 17.820 ns/op ChainedBenchmark.channelChain 0 1000 avgt 5 1005.357 ± 5.138 ns/op ChainedBenchmark.channelChain 0 10000 avgt 5 1010.243 ± 23.558 ns/op ChainedBenchmark.channelChain 100 100 avgt 5 29.639 ± 0.174 ns/op ChainedBenchmark.channelChain 100 1000 avgt 5 29.826 ± 0.664 ns/op ChainedBenchmark.channelChain 100 10000 avgt 5 31.639 ± 2.107 ns/op ChainedBenchmark.queueChain 0 100 avgt 5 114.191 ± 20.811 ns/op ChainedBenchmark.queueChain 0 1000 avgt 5 132.551 ± 29.343 ns/op ChainedBenchmark.queueChain 0 10000 avgt 5 129.440 ± 1.359 ns/op ChainedBenchmark.queueChain 100 100 avgt 5 10.895 ± 0.266 ns/op ChainedBenchmark.queueChain 100 1000 avgt 5 11.089 ± 0.881 ns/op ChainedBenchmark.queueChain 100 10000 avgt 5 10.472 ± 0.226 ns/op RendezvousBenchmark.channel N/A N/A avgt 5 185.665 ± 28.871 ns/op RendezvousBenchmark.exchanger N/A N/A avgt 5 93.172 ± 13.904 ns/op RendezvousBenchmark.synchronousQueue N/A N/A avgt 5 608.254 ± 112.831 ns/op SelectBenchmark.selectWithSingleClause N/A N/A avgt 5 222.792 ± 65.006 ns/op SelectBenchmark.selectWithTwoClauses N/A N/A avgt 5 193.528 ± 20.594 ns/op Kotlin: (capacity) (chainLength) Mode Cnt Score Error Units BufferedKotlinBenchmark.channel_defaultDispatcher 1 N/A avgt 5 118.297 ± 6.379 ns/op BufferedKotlinBenchmark.channel_defaultDispatcher 10 N/A avgt 5 53.925 ± 1.163 ns/op BufferedKotlinBenchmark.channel_defaultDispatcher 100 N/A avgt 5 32.119 ± 0.969 ns/op ChainedKotlinBenchmark.channelChain_defaultDispatcher 0 100 avgt 5 70.253 ± 2.865 ns/op ChainedKotlinBenchmark.channelChain_defaultDispatcher 0 1000 avgt 5 57.327 ± 2.750 ns/op ChainedKotlinBenchmark.channelChain_defaultDispatcher 0 10000 avgt 5 57.463 ± 2.315 ns/op ChainedKotlinBenchmark.channelChain_defaultDispatcher 100 100 avgt 5 13.722 ± 0.397 ns/op ChainedKotlinBenchmark.channelChain_defaultDispatcher 100 1000 avgt 5 13.294 ± 0.481 ns/op ChainedKotlinBenchmark.channelChain_defaultDispatcher 100 10000 avgt 5 14.517 ± 0.704 ns/op ChainedKotlinBenchmark.channelChain_eventLoop 0 100 avgt 5 92.418 ± 5.084 ns/op ChainedKotlinBenchmark.channelChain_eventLoop 0 1000 avgt 5 141.417 ± 17.209 ns/op ChainedKotlinBenchmark.channelChain_eventLoop 0 10000 avgt 5 95.069 ± 5.349 ns/op ChainedKotlinBenchmark.channelChain_eventLoop 100 100 avgt 5 30.176 ± 0.329 ns/op ChainedKotlinBenchmark.channelChain_eventLoop 100 1000 avgt 5 28.648 ± 1.445 ns/op ChainedKotlinBenchmark.channelChain_eventLoop 100 10000 avgt 5 30.985 ± 0.216 ns/op RendezvousKotlinBenchmark.channel_defaultDispatcher N/A N/A avgt 5 152.718 ± 4.334 ns/op SelectKotlinBenchmark.selectWithSingleClause_defaultDispatcher N/A N/A avgt 5 261.616 ± 1.311 ns/op SelectKotlinBenchmark.selectWithTwoClauses_defaultDispatcher N/A N/A avgt 5 362.605 ± 2.960 ns/op ```