typelevel / cats-effect

The pure asynchronous runtime for Scala
https://typelevel.org/cats-effect/
Apache License 2.0
2.03k stars 520 forks source link

Implement async dropping queue #4143

Closed iRevive closed 3 weeks ago

iRevive commented 1 month ago

Closes #4141.

Benchmarks:

Throughput              Async                       Concurrent
enqueueDequeueMany      281.571 ± 4.388 ops/s       144.713 ± 2.057 ops/s
enqueueDequeueOne       281.266 ± 4.599 ops/s       173.974 ± 3.129 ops/s

GC alloc rate           Async                       Concurrent
enqueueDequeueMany      3273.366 ± 51.235 MB/sec    5860.556 ±  82.691 MB/sec
enqueueDequeueOne       3058.866 ± 50.114 MB/sec    6784.491 ± 123.139 MB/sec

GC alloc rate norm      Async                       Concurrent
enqueueDequeueMany      12191147.081 ±  2.533 B/op  42468767.945 ± 65.343 B/op
enqueueDequeueOne       11404702.192 ± 11.867 B/op  40895828.996 ±  4.205 B/op

GC count                Async                       Concurrent
enqueueDequeueMany      898.000  counts             771.000  counts
enqueueDequeueOne       1030.000 counts             1315.000 counts

GC time                 Async                       Concurrent
enqueueDequeueMany      519.000 ms                  1130.000 ms
enqueueDequeueOne       578.000 ms                  771.000  ms