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

Introduce WeakList and use in FiberMonitor #3964

Merged
merged 5 commits into from
Feb 23, 2024

Conversation

armanbilge
Copy link
Member

Fixes #3929 by creating a custom WeakList datastructure inspired by the new CallbackStack introduced in #3943.

Copy link
Member

@djspiewak djspiewak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditionally approved pending benchmarks. The WSTP and parallel ones should be sufficient since they allocate a ton of fibers.

@djspiewak djspiewak added this to the v3.5.next milestone Feb 19, 2024
@djspiewak
Copy link
Member

Before

[info] Benchmark                                             (cpuTokens)   (size)   Mode  Cnt     Score    Error    Units
[info] ParallelBenchmark.parTraverse                               10000     1000  thrpt   10   893.540 ±  1.695    ops/s
[info] ParallelBenchmark.traverse                                  10000     1000  thrpt   10    70.238 ±  0.117    ops/s
[info] WorkStealingBenchmark.alloc                                   N/A  1000000  thrpt   10    13.939 ±  0.124  ops/min
[info] WorkStealingBenchmark.manyThreadsSchedulingBenchmark          N/A  1000000  thrpt   10    48.600 ±  2.862  ops/min
[info] WorkStealingBenchmark.runnableScheduling                      N/A  1000000  thrpt   10  2958.431 ± 11.388  ops/min
[info] WorkStealingBenchmark.runnableSchedulingScalaGlobal           N/A  1000000  thrpt   10  2179.764 ± 20.288  ops/min
[info] WorkStealingBenchmark.scheduling                              N/A  1000000  thrpt   10    50.254 ±  3.102  ops/min

After

[info] Benchmark                                             (cpuTokens)   (size)   Mode  Cnt     Score    Error    Units
[info] ParallelBenchmark.parTraverse                               10000     1000  thrpt   10   903.096 ±  4.072    ops/s
[info] ParallelBenchmark.traverse                                  10000     1000  thrpt   10    65.055 ±  5.206    ops/s
[info] WorkStealingBenchmark.alloc                                   N/A  1000000  thrpt   10    13.677 ±  0.164  ops/min
[info] WorkStealingBenchmark.manyThreadsSchedulingBenchmark          N/A  1000000  thrpt   10    45.320 ±  2.022  ops/min
[info] WorkStealingBenchmark.runnableScheduling                      N/A  1000000  thrpt   10  2965.083 ± 33.915  ops/min
[info] WorkStealingBenchmark.runnableSchedulingScalaGlobal           N/A  1000000  thrpt   10  2194.897 ± 27.816  ops/min
[info] WorkStealingBenchmark.scheduling                              N/A  1000000  thrpt   10    50.026 ±  3.685  ops/min

The traverse results are weird and probably just noise on my testing system. The rest is all within the margin of error.

@djspiewak djspiewak merged commit 9c9ec63 into typelevel:series/3.5.x Feb 23, 2024
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leaking fiber monitors when running in custom IORuntime using JDK 21 virtual threads
2 participants