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

Simplify the transfer of WorkerThread data structures when blocking #2769

Merged
merged 8 commits into from
Jan 23, 2022
Merged

Simplify the transfer of WorkerThread data structures when blocking #2769

merged 8 commits into from
Jan 23, 2022

Conversation

vasilmkd
Copy link
Member

Simplifies the code by moving the references to the data structures inside the pool itself, where the WorkerThreads can fetch it from as soon as they are assigned an index. I have plans to further simplify the code, I would like to get rid of the ArrayBlockingQueue[Integer] (Integer needed because null is a part of the API and we don't want autoboxing to be coerced to a 0 by Scala), but there are enough changes in this PR.

This will also be a nice cleanup when I introduce the sleep improvements.

@vasilmkd
Copy link
Member Author

There are no performance regressions.

series/3.3.x:

Benchmark                        (size)   Mode  Cnt     Score     Error  Units
BlockingBenchmark.blockThenCede   10000  thrpt   20     6.585 ±   0.231  ops/s
BlockingBenchmark.coarse          10000  thrpt   20  3456.943 ± 105.862  ops/s
BlockingBenchmark.fine            10000  thrpt   20   760.317 ±  10.131  ops/s
BlockingBenchmark.nested          10000  thrpt   20   749.588 ±  10.078  ops/s

This PR:

Benchmark                        (size)   Mode  Cnt     Score     Error  Units
BlockingBenchmark.blockThenCede   10000  thrpt   20     6.626 ±   0.269  ops/s
BlockingBenchmark.coarse          10000  thrpt   20  3507.987 ± 136.174  ops/s
BlockingBenchmark.fine            10000  thrpt   20   756.288 ±  12.685  ops/s
BlockingBenchmark.nested          10000  thrpt   20   745.676 ±  15.207  ops/s

Comment on lines +456 to +457
if (isDotty.value) {
// Scala 3 specific exclusions
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Good to know. Thanks.

@djspiewak djspiewak merged commit 0bdeaea into typelevel:series/3.3.x Jan 23, 2022
@vasilmkd vasilmkd deleted the data-structures-in-pool branch January 23, 2022 21:04
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