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

parEvalMapUnordered performance #2626

Merged
merged 5 commits into from
Sep 23, 2021

Conversation

nikiforo
Copy link
Contributor

issue: #2297

MR has three commits, the first one contains the implementation of parEvalMapUnordered
using queue. In the second one channel is used instead. Both show 4x performance boost in the benchmark.

Queue version can be backported to 2.x

original
[info] Benchmark                                  (chunkSize)  (size)   Mode  Cnt      Score     Error  Units
[info] ParEvalMapBenchmark.evalMap                         10     100  thrpt    5  18371,696 ± 691,166  ops/s
[info] ParEvalMapBenchmark.evalMap                         10   10000  thrpt    5    268,572 ±  50,354  ops/s
[info] ParEvalMapBenchmark.evalMap                        100     100  thrpt    5  20519,182 ± 700,520  ops/s
[info] ParEvalMapBenchmark.evalMap                        100   10000  thrpt    5    327,894 ±  13,484  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10           10     100  thrpt    5    247,284 ±  13,961  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10           10   10000  thrpt    5      2,690 ±   0,216  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10          100     100  thrpt    5    243,230 ±  63,045  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10          100   10000  thrpt    5      2,514 ±   0,909  ops/s

queue
[info] Benchmark                                  (chunkSize)  (size)   Mode  Cnt      Score       Error  Units
[info] ParEvalMapBenchmark.evalMap                         10     100  thrpt    5  14941,125 ± 15793,397  ops/s
[info] ParEvalMapBenchmark.evalMap                         10   10000  thrpt    5    271,087 ±    32,569  ops/s
[info] ParEvalMapBenchmark.evalMap                        100     100  thrpt    5  21112,826 ±  1200,298  ops/s
[info] ParEvalMapBenchmark.evalMap                        100   10000  thrpt    5    333,532 ±    29,564  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10           10     100  thrpt    5    777,716 ±    51,634  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10           10   10000  thrpt    5      8,548 ±     1,527  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10          100     100  thrpt    5    751,344 ±   140,702  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10          100   10000  thrpt    5      8,680 ±     0,625  ops/s

channel
[info] Benchmark                                  (chunkSize)  (size)   Mode  Cnt      Score       Error  Units
[info] ParEvalMapBenchmark.evalMap                         10     100  thrpt    5  14737,644 ± 11934,801  ops/s
[info] ParEvalMapBenchmark.evalMap                         10   10000  thrpt    5    269,426 ±    27,346  ops/s
[info] ParEvalMapBenchmark.evalMap                        100     100  thrpt    5  20672,646 ±  3040,174  ops/s
[info] ParEvalMapBenchmark.evalMap                        100   10000  thrpt    5    326,514 ±    16,164  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10           10     100  thrpt    5    690,876 ±   103,356  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10           10   10000  thrpt    5      8,636 ±     2,096  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10          100     100  thrpt    5    798,570 ±    58,991  ops/s
[info] ParEvalMapBenchmark.parEvalMapUnordered10          100   10000  thrpt    5      8,620 ±     1,949  ops/s

@nikiforo nikiforo mentioned this pull request Sep 21, 2021
core/shared/src/main/scala/fs2/Stream.scala Outdated Show resolved Hide resolved
core/shared/src/main/scala/fs2/Stream.scala Outdated Show resolved Hide resolved
core/shared/src/main/scala/fs2/Stream.scala Outdated Show resolved Hide resolved
@mpilquist mpilquist merged commit 2ac85a2 into typelevel:main Sep 23, 2021
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.

3 participants