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

Implement unlimited channels #29

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Implement unlimited channels #29

merged 2 commits into from
Jan 5, 2024

Conversation

adamw
Copy link
Member

@adamw adamw commented Jan 5, 2024

Closes #4

Copy link

github-actions bot commented Jan 5, 2024

Benchmark results
Java:
(capacity)  Mode  Cnt     Score    Error  Units
BufferedBenchmark.array_blocking_queue                                      1  avgt   15  1103.693 ± 34.226  ns/op
BufferedBenchmark.array_blocking_queue:putToArrayBlockingQueue              1  avgt   15  1103.696 ± 34.224  ns/op
BufferedBenchmark.array_blocking_queue:takeFromArrayBlockingQueue           1  avgt   15  1103.691 ± 34.228  ns/op
BufferedBenchmark.array_blocking_queue                                     10  avgt   15   223.870 ± 14.508  ns/op
BufferedBenchmark.array_blocking_queue:putToArrayBlockingQueue             10  avgt   15   223.870 ± 14.508  ns/op
BufferedBenchmark.array_blocking_queue:takeFromArrayBlockingQueue          10  avgt   15   223.871 ± 14.508  ns/op
BufferedBenchmark.array_blocking_queue                                    100  avgt   15   153.976 ± 18.754  ns/op
BufferedBenchmark.array_blocking_queue:putToArrayBlockingQueue            100  avgt   15   153.976 ± 18.754  ns/op
BufferedBenchmark.array_blocking_queue:takeFromArrayBlockingQueue         100  avgt   15   153.976 ± 18.754  ns/op
BufferedBenchmark.channel                                                   1  avgt   15   192.062 ± 20.342  ns/op
BufferedBenchmark.channel:receiveFromChannel                                1  avgt   15   192.063 ± 20.342  ns/op
BufferedBenchmark.channel:sendToChannel                                     1  avgt   15   192.061 ± 20.342  ns/op
BufferedBenchmark.channel                                                  10  avgt   15   170.121 ±  4.349  ns/op
BufferedBenchmark.channel:receiveFromChannel                               10  avgt   15   170.122 ±  4.350  ns/op
BufferedBenchmark.channel:sendToChannel                                    10  avgt   15   170.119 ±  4.348  ns/op
BufferedBenchmark.channel                                                 100  avgt   15   147.757 ± 11.877  ns/op
BufferedBenchmark.channel:receiveFromChannel                              100  avgt   15   147.758 ± 11.878  ns/op
BufferedBenchmark.channel:sendToChannel                                   100  avgt   15   147.757 ± 11.875  ns/op
BufferedBenchmark.channel_iterative                                         1  avgt   15   196.643 ± 21.563  ns/op
BufferedBenchmark.channel_iterative                                        10  avgt   15   176.257 ± 10.309  ns/op
BufferedBenchmark.channel_iterative                                       100  avgt   15   127.573 ±  8.374  ns/op
RendezvousBenchmark.channel                                               N/A  avgt   15   190.160 ± 12.159  ns/op
RendezvousBenchmark.channel:receiveFromChannel                            N/A  avgt   15   190.158 ± 12.159  ns/op
RendezvousBenchmark.channel:sendToChannel                                 N/A  avgt   15   190.161 ± 12.159  ns/op
RendezvousBenchmark.channel_iterative                                     N/A  avgt   15   195.357 ±  7.100  ns/op
RendezvousBenchmark.exchanger                                             N/A  avgt   15   100.252 ±  4.378  ns/op
RendezvousBenchmark.exchanger:exchange1                                   N/A  avgt   15   100.252 ±  4.378  ns/op
RendezvousBenchmark.exchanger:exchange2                                   N/A  avgt   15   100.252 ±  4.378  ns/op
RendezvousBenchmark.synchronous_queue                                     N/A  avgt   15   203.933 ±  6.092  ns/op
RendezvousBenchmark.synchronous_queue:putToSynchronousQueue               N/A  avgt   15   203.930 ±  6.091  ns/op
RendezvousBenchmark.synchronous_queue:takeFromSynchronousQueue            N/A  avgt   15   203.935 ±  6.092  ns/op
SelectBenchmark.channel                                                   N/A  avgt   15   220.570 ±  7.919  ns/op
SelectBenchmark.channel:receiveFromChannelUsingSelect                     N/A  avgt   15   220.570 ±  7.918  ns/op
SelectBenchmark.channel:sendToChannel                                     N/A  avgt   15   220.570 ±  7.919  ns/op
SelectBenchmark.single_channel_iterative                                  N/A  avgt   15   227.974 ± 26.769  ns/op
SelectBenchmark.two_channels_iterative                                    N/A  avgt   15   259.144 ± 56.675  ns/op

Kotlin:
(capacity)  Mode  Cnt    Score    Error  Units
BufferedKotlinBenchmark.sendReceiveUsingDefaultDispatcher                              1  avgt   15  111.603 ±  3.872  ns/op
BufferedKotlinBenchmark.sendReceiveUsingDefaultDispatcher                             10  avgt   15   51.874 ±  0.626  ns/op
BufferedKotlinBenchmark.sendReceiveUsingDefaultDispatcher                            100  avgt   15   32.190 ±  0.314  ns/op
RendezvousKotlinBenchmark.sendReceiveUsingDefaultDispatcher                          N/A  avgt   15  142.137 ±  2.945  ns/op
SelectKotlinBenchmark.sendReceiveUsingSelect_singleChannel_defaultDispatcher         N/A  avgt   15  258.970 ±  7.418  ns/op
SelectKotlinBenchmark.sendReceiveUsingSelect_twoChannels_defaultDispatcher           N/A  avgt   15  349.801 ± 25.130  ns/op

@adamw adamw merged commit 5d2095a into main Jan 5, 2024
1 check passed
@adamw adamw deleted the unlimited-channels branch January 5, 2024 19:28
Copy link

github-actions bot commented Jan 5, 2024

Benchmark results
Java:
(capacity)  Mode  Cnt     Score     Error  Units
BufferedBenchmark.array_blocking_queue                                      1  avgt   15  1200.048 ± 115.343  ns/op
BufferedBenchmark.array_blocking_queue:putToArrayBlockingQueue              1  avgt   15  1200.049 ± 115.350  ns/op
BufferedBenchmark.array_blocking_queue:takeFromArrayBlockingQueue           1  avgt   15  1200.047 ± 115.337  ns/op
BufferedBenchmark.array_blocking_queue                                     10  avgt   15   243.868 ±  23.697  ns/op
BufferedBenchmark.array_blocking_queue:putToArrayBlockingQueue             10  avgt   15   243.867 ±  23.696  ns/op
BufferedBenchmark.array_blocking_queue:takeFromArrayBlockingQueue          10  avgt   15   243.869 ±  23.698  ns/op
BufferedBenchmark.array_blocking_queue                                    100  avgt   15   153.484 ±  15.965  ns/op
BufferedBenchmark.array_blocking_queue:putToArrayBlockingQueue            100  avgt   15   153.484 ±  15.965  ns/op
BufferedBenchmark.array_blocking_queue:takeFromArrayBlockingQueue         100  avgt   15   153.484 ±  15.965  ns/op
BufferedBenchmark.channel                                                   1  avgt   15   220.145 ±   8.542  ns/op
BufferedBenchmark.channel:receiveFromChannel                                1  avgt   15   220.145 ±   8.544  ns/op
BufferedBenchmark.channel:sendToChannel                                     1  avgt   15   220.146 ±   8.540  ns/op
BufferedBenchmark.channel                                                  10  avgt   15   178.103 ±   6.370  ns/op
BufferedBenchmark.channel:receiveFromChannel                               10  avgt   15   178.103 ±   6.369  ns/op
BufferedBenchmark.channel:sendToChannel                                    10  avgt   15   178.102 ±   6.370  ns/op
BufferedBenchmark.channel                                                 100  avgt   15   148.973 ±  11.755  ns/op
BufferedBenchmark.channel:receiveFromChannel                              100  avgt   15   148.974 ±  11.751  ns/op
BufferedBenchmark.channel:sendToChannel                                   100  avgt   15   148.972 ±  11.758  ns/op
BufferedBenchmark.channel_iterative                                         1  avgt   15   223.267 ±  17.336  ns/op
BufferedBenchmark.channel_iterative                                        10  avgt   15   171.504 ±   5.007  ns/op
BufferedBenchmark.channel_iterative                                       100  avgt   15   136.710 ±   8.434  ns/op
RendezvousBenchmark.channel                                               N/A  avgt   15   189.685 ±  10.466  ns/op
RendezvousBenchmark.channel:receiveFromChannel                            N/A  avgt   15   189.687 ±  10.465  ns/op
RendezvousBenchmark.channel:sendToChannel                                 N/A  avgt   15   189.684 ±  10.466  ns/op
RendezvousBenchmark.channel_iterative                                     N/A  avgt   15   188.094 ±   8.978  ns/op
RendezvousBenchmark.exchanger                                             N/A  avgt   15    96.670 ±   3.418  ns/op
RendezvousBenchmark.exchanger:exchange1                                   N/A  avgt   15    96.670 ±   3.418  ns/op
RendezvousBenchmark.exchanger:exchange2                                   N/A  avgt   15    96.671 ±   3.418  ns/op
RendezvousBenchmark.synchronous_queue                                     N/A  avgt   15   200.813 ±   9.725  ns/op
RendezvousBenchmark.synchronous_queue:putToSynchronousQueue               N/A  avgt   15   200.813 ±   9.725  ns/op
RendezvousBenchmark.synchronous_queue:takeFromSynchronousQueue            N/A  avgt   15   200.812 ±   9.725  ns/op
SelectBenchmark.channel                                                   N/A  avgt   15   300.452 ± 126.736  ns/op
SelectBenchmark.channel:receiveFromChannelUsingSelect                     N/A  avgt   15   300.452 ± 126.737  ns/op
SelectBenchmark.channel:sendToChannel                                     N/A  avgt   15   300.452 ± 126.734  ns/op
SelectBenchmark.single_channel_iterative                                  N/A  avgt   15   221.770 ±   8.607  ns/op
SelectBenchmark.two_channels_iterative                                    N/A  avgt   15   267.204 ±  50.969  ns/op

Kotlin:
(capacity)  Mode  Cnt    Score    Error  Units
BufferedKotlinBenchmark.sendReceiveUsingDefaultDispatcher                              1  avgt   15  158.301 ± 93.684  ns/op
BufferedKotlinBenchmark.sendReceiveUsingDefaultDispatcher                             10  avgt   15   51.362 ±  1.149  ns/op
BufferedKotlinBenchmark.sendReceiveUsingDefaultDispatcher                            100  avgt   15   33.131 ±  1.206  ns/op
RendezvousKotlinBenchmark.sendReceiveUsingDefaultDispatcher                          N/A  avgt   15  144.697 ±  4.197  ns/op
SelectKotlinBenchmark.sendReceiveUsingSelect_singleChannel_defaultDispatcher         N/A  avgt   15  255.074 ± 12.411  ns/op
SelectKotlinBenchmark.sendReceiveUsingSelect_twoChannels_defaultDispatcher           N/A  avgt   15  330.132 ± 18.180  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.

Support unlimited channels
1 participant