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

Run GC on multiple threads #48600

Merged
merged 1 commit into from
Apr 28, 2023
Merged

Run GC on multiple threads #48600

merged 1 commit into from
Apr 28, 2023

Conversation

d-netto
Copy link
Member

@d-netto d-netto commented Feb 9, 2023

Summary

This PR parallelizes the GC mark-loop by introducing GC threads into the Julia runtime and by implementing work-stealing to dynamically balance the amount of work each thread performs in the GC mark-loop.

Implementation

Following #47292, each thread running the GC mark-loop manages two work-queues: one queue stores pointers to Julia objects that need to be scanned, and another queue (chunk queue) stores iterator states corresponding to suffixes of large arrays that need to be scanned.

Both the pointer and chunk queues are lock-free and are based on the work of Chase-Lev and Le et. al (see papers referenced in work-stealing-queue.h).

Results

These are speedups in mark-time for a tweaked (JuliaCI/GCBenchmarks#61) version of the rb_tree.jl benchmark from GCBenchmarks. This representative benchmark uses a single mutator thread (we scale the number of GC threads in the plots below). For more benchmarks, see @vchuravy's comment below.

Machine

  • 262 GB RAM
  • ARM Neoverse-N1 80-Core Processor

Speedups

plot

@d-netto d-netto requested a review from vtjnash February 9, 2023 04:40
@d-netto d-netto added the GC Garbage collector label Feb 9, 2023
@d-netto d-netto requested a review from vchuravy February 9, 2023 04:41
@vchuravy vchuravy marked this pull request as draft February 10, 2023 16:05
@vchuravy vchuravy changed the title WIP: GC threads GC threads Feb 10, 2023
@vchuravy
Copy link
Sponsor Member

I assume this depends on #48123 for good performance on AMD?

src/chase-lev-deque.h Outdated Show resolved Hide resolved
@d-netto
Copy link
Member Author

d-netto commented Feb 10, 2023

The number of GC threads can be specified through --gc=N. The previous green check on Test could be misleading, since we are not actually running the GC in parallel (it defaults to single-threaded when --gc is not specified).

It would be nice to run CI with multiple GC threads (worst case, I think we can chose a higher default count of GC threads for testing purposes).

@d-netto
Copy link
Member Author

d-netto commented Feb 10, 2023

Same for PkgEval.

src/jloptions.c Outdated Show resolved Hide resolved
@vchuravy
Copy link
Sponsor Member

Same for PkgEval.

You can do: runtests(configuration=(julia_flags=["--gc=4"],)) I think. @maleadt is there an option to apply julia_flags to only the current build not the versus build?

@d-netto d-netto force-pushed the dcn/gcthreads branch 3 times, most recently from 5489db2 to 9698e23 Compare February 11, 2023 04:44
@maleadt
Copy link
Member

maleadt commented Feb 11, 2023

You can do: runtests(configuration=(julia_flags=["--gc=4"],)) I think. @maleadt is there an option to apply julia_flags to only the current build not the versus build?

The configuration is only applied to the primary build, to influence the versus build you specify vs_configuration.

@d-netto d-netto force-pushed the dcn/gcthreads branch 2 times, most recently from 33137cf to 88ebe01 Compare February 12, 2023 23:11
@vchuravy
Copy link
Sponsor Member

@nanosoldier runtests(configuration=(julia_flags=["--gc=4"],))

@nanosoldier
Copy link
Collaborator

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

@d-netto d-netto force-pushed the dcn/gcthreads branch 4 times, most recently from dc2c305 to 40c9618 Compare February 17, 2023 15:53
@d-netto d-netto marked this pull request as ready for review February 17, 2023 17:32
@d-netto d-netto mentioned this pull request Feb 19, 2023
3 tasks
@d-netto d-netto force-pushed the dcn/gcthreads branch 4 times, most recently from 3624656 to b5b5791 Compare February 20, 2023 19:50
@KristofferC
Copy link
Sponsor Member

Just checking if #49545 (comment) should be understood first?

@oscardssmith
Copy link
Member

I don't think so. It appears to be totally unrelated.

@vchuravy vchuravy merged commit abeecee into JuliaLang:master Apr 28, 2023
@d-netto d-netto removed the status:merge me PR is reviewed. Merge when all tests are passing label Apr 29, 2023
kpamnany pushed a commit to RelationalAI/julia that referenced this pull request Oct 19, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Oct 20, 2023
kpamnany pushed a commit to RelationalAI/julia that referenced this pull request Oct 21, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Oct 23, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 1, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 2, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 7, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 10, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 14, 2023
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Nov 15, 2023
d-netto added a commit that referenced this pull request Jan 23, 2024
…alse-sharing (#52994)

For some reason this only shows up in the `many_refs.jl` benchmark,
since it's the only one that hammers the work-stealing queue (we also
didn't test this benchmark on a large number of GC threads in our
[previous
analysis](#48600 (comment))).

- master:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4268 │    3243 │      3048 │        194 │         1126 │                15 │      868 │         76 │
│  median │       4270 │    3246 │      3051 │        195 │         1128 │                17 │      868 │         76 │
│ maximum │       4278 │    3247 │      3052 │        195 │         1128 │                18 │      868 │         76 │
│   stdev │          5 │       2 │         2 │          0 │            1 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2728 │    1692 │      1551 │        141 │          598 │                23 │      868 │         62 │
│  median │       2732 │    1709 │      1567 │        141 │          603 │                23 │      868 │         62 │
│ maximum │       2744 │    1712 │      1571 │        143 │          607 │                24 │      868 │         63 │
│   stdev │          6 │       9 │         9 │          1 │            4 │                 0 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2105 │    1082 │       987 │         95 │          405 │                23 │      875 │         51 │
│  median │       2115 │    1089 │       994 │         95 │          409 │                23 │      875 │         52 │
│ maximum │       2127 │    1100 │      1003 │         97 │          417 │                25 │      875 │         52 │
│   stdev │          8 │       8 │         7 │          1 │            5 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       3861 │    2755 │      2676 │         79 │         1301 │                22 │      878 │         68 │
│  median │       3864 │    2835 │      2756 │         80 │         1342 │                25 │      879 │         73 │
│ maximum │       4032 │    2877 │      2797 │         80 │         1378 │                26 │      880 │         74 │
│   stdev │         73 │      45 │        45 │          1 │           28 │                 2 │        1 │          2 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       7455 │    6425 │      6344 │         80 │         3262 │                24 │      882 │         86 │
│  median │       7703 │    6682 │      6602 │         81 │         3313 │                25 │      884 │         87 │
│ maximum │       7826 │    6806 │      6725 │         81 │         3422 │                27 │      887 │         87 │
│   stdev │        152 │     153 │       153 │          0 │           68 │                 1 │        2 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

- PR:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4264 │    3240 │      3048 │        192 │         1127 │                15 │      868 │         76 │
│  median │       4271 │    3244 │      3052 │        192 │         1129 │                17 │      868 │         76 │
│ maximum │       4514 │    3481 │      3289 │        193 │         1247 │                18 │      868 │         77 │
│   stdev │        109 │     106 │       106 │          0 │           53 │                 1 │        0 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2712 │    1680 │      1541 │        138 │          591 │                22 │      868 │         62 │
│  median │       2713 │    1691 │      1552 │        140 │          594 │                24 │      868 │         62 │
│ maximum │       2732 │    1710 │      1569 │        141 │          606 │                25 │      868 │         63 │
│   stdev │         11 │      12 │        12 │          1 │            6 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2090 │    1057 │       962 │         95 │          398 │                22 │      874 │         50 │
│  median │       2103 │    1070 │       974 │         95 │          401 │                24 │      874 │         51 │
│ maximum │       2140 │    1074 │       978 │         96 │          402 │                25 │      875 │         51 │
│   stdev │         19 │       6 │         6 │          0 │            1 │                 1 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2236 │    1208 │      1129 │         79 │          528 │                23 │      880 │         54 │
│  median │       2238 │    1214 │      1135 │         79 │          533 │                23 │      880 │         54 │
│ maximum │       2246 │    1218 │      1138 │         80 │          534 │                35 │      880 │         54 │
│   stdev │          4 │       4 │         4 │          0 │            3 │                 5 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2326 │    1297 │      1216 │         80 │          595 │                24 │      884 │         56 │
│  median │       2348 │    1325 │      1245 │         80 │          620 │                25 │      885 │         56 │
│ maximum │       2370 │    1341 │      1262 │         81 │          631 │                26 │      887 │         57 │
│   stdev │         17 │      19 │        19 │          0 │           14 │                 1 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```
d-netto added a commit to RelationalAI/julia that referenced this pull request Jan 23, 2024
…alse-sharing (JuliaLang#52994)

For some reason this only shows up in the `many_refs.jl` benchmark,
since it's the only one that hammers the work-stealing queue (we also
didn't test this benchmark on a large number of GC threads in our
[previous
analysis](JuliaLang#48600 (comment))).

- master:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4268 │    3243 │      3048 │        194 │         1126 │                15 │      868 │         76 │
│  median │       4270 │    3246 │      3051 │        195 │         1128 │                17 │      868 │         76 │
│ maximum │       4278 │    3247 │      3052 │        195 │         1128 │                18 │      868 │         76 │
│   stdev │          5 │       2 │         2 │          0 │            1 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2728 │    1692 │      1551 │        141 │          598 │                23 │      868 │         62 │
│  median │       2732 │    1709 │      1567 │        141 │          603 │                23 │      868 │         62 │
│ maximum │       2744 │    1712 │      1571 │        143 │          607 │                24 │      868 │         63 │
│   stdev │          6 │       9 │         9 │          1 │            4 │                 0 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2105 │    1082 │       987 │         95 │          405 │                23 │      875 │         51 │
│  median │       2115 │    1089 │       994 │         95 │          409 │                23 │      875 │         52 │
│ maximum │       2127 │    1100 │      1003 │         97 │          417 │                25 │      875 │         52 │
│   stdev │          8 │       8 │         7 │          1 │            5 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       3861 │    2755 │      2676 │         79 │         1301 │                22 │      878 │         68 │
│  median │       3864 │    2835 │      2756 │         80 │         1342 │                25 │      879 │         73 │
│ maximum │       4032 │    2877 │      2797 │         80 │         1378 │                26 │      880 │         74 │
│   stdev │         73 │      45 │        45 │          1 │           28 │                 2 │        1 │          2 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       7455 │    6425 │      6344 │         80 │         3262 │                24 │      882 │         86 │
│  median │       7703 │    6682 │      6602 │         81 │         3313 │                25 │      884 │         87 │
│ maximum │       7826 │    6806 │      6725 │         81 │         3422 │                27 │      887 │         87 │
│   stdev │        152 │     153 │       153 │          0 │           68 │                 1 │        2 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

- PR:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4264 │    3240 │      3048 │        192 │         1127 │                15 │      868 │         76 │
│  median │       4271 │    3244 │      3052 │        192 │         1129 │                17 │      868 │         76 │
│ maximum │       4514 │    3481 │      3289 │        193 │         1247 │                18 │      868 │         77 │
│   stdev │        109 │     106 │       106 │          0 │           53 │                 1 │        0 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2712 │    1680 │      1541 │        138 │          591 │                22 │      868 │         62 │
│  median │       2713 │    1691 │      1552 │        140 │          594 │                24 │      868 │         62 │
│ maximum │       2732 │    1710 │      1569 │        141 │          606 │                25 │      868 │         63 │
│   stdev │         11 │      12 │        12 │          1 │            6 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2090 │    1057 │       962 │         95 │          398 │                22 │      874 │         50 │
│  median │       2103 │    1070 │       974 │         95 │          401 │                24 │      874 │         51 │
│ maximum │       2140 │    1074 │       978 │         96 │          402 │                25 │      875 │         51 │
│   stdev │         19 │       6 │         6 │          0 │            1 │                 1 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2236 │    1208 │      1129 │         79 │          528 │                23 │      880 │         54 │
│  median │       2238 │    1214 │      1135 │         79 │          533 │                23 │      880 │         54 │
│ maximum │       2246 │    1218 │      1138 │         80 │          534 │                35 │      880 │         54 │
│   stdev │          4 │       4 │         4 │          0 │            3 │                 5 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2326 │    1297 │      1216 │         80 │          595 │                24 │      884 │         56 │
│  median │       2348 │    1325 │      1245 │         80 │          620 │                25 │      885 │         56 │
│ maximum │       2370 │    1341 │      1262 │         81 │          631 │                26 │      887 │         57 │
│   stdev │         17 │      19 │        19 │          0 │           14 │                 1 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```
DelveCI pushed a commit to RelationalAI/julia that referenced this pull request Jan 24, 2024
…alse-sharing (JuliaLang#52994)

For some reason this only shows up in the `many_refs.jl` benchmark,
since it's the only one that hammers the work-stealing queue (we also
didn't test this benchmark on a large number of GC threads in our
[previous
analysis](JuliaLang#48600 (comment))).

- master:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4268 │    3243 │      3048 │        194 │         1126 │                15 │      868 │         76 │
│  median │       4270 │    3246 │      3051 │        195 │         1128 │                17 │      868 │         76 │
│ maximum │       4278 │    3247 │      3052 │        195 │         1128 │                18 │      868 │         76 │
│   stdev │          5 │       2 │         2 │          0 │            1 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2728 │    1692 │      1551 │        141 │          598 │                23 │      868 │         62 │
│  median │       2732 │    1709 │      1567 │        141 │          603 │                23 │      868 │         62 │
│ maximum │       2744 │    1712 │      1571 │        143 │          607 │                24 │      868 │         63 │
│   stdev │          6 │       9 │         9 │          1 │            4 │                 0 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2105 │    1082 │       987 │         95 │          405 │                23 │      875 │         51 │
│  median │       2115 │    1089 │       994 │         95 │          409 │                23 │      875 │         52 │
│ maximum │       2127 │    1100 │      1003 │         97 │          417 │                25 │      875 │         52 │
│   stdev │          8 │       8 │         7 │          1 │            5 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       3861 │    2755 │      2676 │         79 │         1301 │                22 │      878 │         68 │
│  median │       3864 │    2835 │      2756 │         80 │         1342 │                25 │      879 │         73 │
│ maximum │       4032 │    2877 │      2797 │         80 │         1378 │                26 │      880 │         74 │
│   stdev │         73 │      45 │        45 │          1 │           28 │                 2 │        1 │          2 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       7455 │    6425 │      6344 │         80 │         3262 │                24 │      882 │         86 │
│  median │       7703 │    6682 │      6602 │         81 │         3313 │                25 │      884 │         87 │
│ maximum │       7826 │    6806 │      6725 │         81 │         3422 │                27 │      887 │         87 │
│   stdev │        152 │     153 │       153 │          0 │           68 │                 1 │        2 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

- PR:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4264 │    3240 │      3048 │        192 │         1127 │                15 │      868 │         76 │
│  median │       4271 │    3244 │      3052 │        192 │         1129 │                17 │      868 │         76 │
│ maximum │       4514 │    3481 │      3289 │        193 │         1247 │                18 │      868 │         77 │
│   stdev │        109 │     106 │       106 │          0 │           53 │                 1 │        0 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2712 │    1680 │      1541 │        138 │          591 │                22 │      868 │         62 │
│  median │       2713 │    1691 │      1552 │        140 │          594 │                24 │      868 │         62 │
│ maximum │       2732 │    1710 │      1569 │        141 │          606 │                25 │      868 │         63 │
│   stdev │         11 │      12 │        12 │          1 │            6 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2090 │    1057 │       962 │         95 │          398 │                22 │      874 │         50 │
│  median │       2103 │    1070 │       974 │         95 │          401 │                24 │      874 │         51 │
│ maximum │       2140 │    1074 │       978 │         96 │          402 │                25 │      875 │         51 │
│   stdev │         19 │       6 │         6 │          0 │            1 │                 1 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2236 │    1208 │      1129 │         79 │          528 │                23 │      880 │         54 │
│  median │       2238 │    1214 │      1135 │         79 │          533 │                23 │      880 │         54 │
│ maximum │       2246 │    1218 │      1138 │         80 │          534 │                35 │      880 │         54 │
│   stdev │          4 │       4 │         4 │          0 │            3 │                 5 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2326 │    1297 │      1216 │         80 │          595 │                24 │      884 │         56 │
│  median │       2348 │    1325 │      1245 │         80 │          620 │                25 │      885 │         56 │
│ maximum │       2370 │    1341 │      1262 │         81 │          631 │                26 │      887 │         57 │
│   stdev │         17 │      19 │        19 │          0 │           14 │                 1 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```
KristofferC pushed a commit that referenced this pull request Jan 24, 2024
…alse-sharing (#52994)

For some reason this only shows up in the `many_refs.jl` benchmark,
since it's the only one that hammers the work-stealing queue (we also
didn't test this benchmark on a large number of GC threads in our
[previous
analysis](#48600 (comment))).

- master:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4268 │    3243 │      3048 │        194 │         1126 │                15 │      868 │         76 │
│  median │       4270 │    3246 │      3051 │        195 │         1128 │                17 │      868 │         76 │
│ maximum │       4278 │    3247 │      3052 │        195 │         1128 │                18 │      868 │         76 │
│   stdev │          5 │       2 │         2 │          0 │            1 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2728 │    1692 │      1551 │        141 │          598 │                23 │      868 │         62 │
│  median │       2732 │    1709 │      1567 │        141 │          603 │                23 │      868 │         62 │
│ maximum │       2744 │    1712 │      1571 │        143 │          607 │                24 │      868 │         63 │
│   stdev │          6 │       9 │         9 │          1 │            4 │                 0 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2105 │    1082 │       987 │         95 │          405 │                23 │      875 │         51 │
│  median │       2115 │    1089 │       994 │         95 │          409 │                23 │      875 │         52 │
│ maximum │       2127 │    1100 │      1003 │         97 │          417 │                25 │      875 │         52 │
│   stdev │          8 │       8 │         7 │          1 │            5 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       3861 │    2755 │      2676 │         79 │         1301 │                22 │      878 │         68 │
│  median │       3864 │    2835 │      2756 │         80 │         1342 │                25 │      879 │         73 │
│ maximum │       4032 │    2877 │      2797 │         80 │         1378 │                26 │      880 │         74 │
│   stdev │         73 │      45 │        45 │          1 │           28 │                 2 │        1 │          2 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       7455 │    6425 │      6344 │         80 │         3262 │                24 │      882 │         86 │
│  median │       7703 │    6682 │      6602 │         81 │         3313 │                25 │      884 │         87 │
│ maximum │       7826 │    6806 │      6725 │         81 │         3422 │                27 │      887 │         87 │
│   stdev │        152 │     153 │       153 │          0 │           68 │                 1 │        2 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

- PR:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4264 │    3240 │      3048 │        192 │         1127 │                15 │      868 │         76 │
│  median │       4271 │    3244 │      3052 │        192 │         1129 │                17 │      868 │         76 │
│ maximum │       4514 │    3481 │      3289 │        193 │         1247 │                18 │      868 │         77 │
│   stdev │        109 │     106 │       106 │          0 │           53 │                 1 │        0 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2712 │    1680 │      1541 │        138 │          591 │                22 │      868 │         62 │
│  median │       2713 │    1691 │      1552 │        140 │          594 │                24 │      868 │         62 │
│ maximum │       2732 │    1710 │      1569 │        141 │          606 │                25 │      868 │         63 │
│   stdev │         11 │      12 │        12 │          1 │            6 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2090 │    1057 │       962 │         95 │          398 │                22 │      874 │         50 │
│  median │       2103 │    1070 │       974 │         95 │          401 │                24 │      874 │         51 │
│ maximum │       2140 │    1074 │       978 │         96 │          402 │                25 │      875 │         51 │
│   stdev │         19 │       6 │         6 │          0 │            1 │                 1 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2236 │    1208 │      1129 │         79 │          528 │                23 │      880 │         54 │
│  median │       2238 │    1214 │      1135 │         79 │          533 │                23 │      880 │         54 │
│ maximum │       2246 │    1218 │      1138 │         80 │          534 │                35 │      880 │         54 │
│   stdev │          4 │       4 │         4 │          0 │            3 │                 5 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2326 │    1297 │      1216 │         80 │          595 │                24 │      884 │         56 │
│  median │       2348 │    1325 │      1245 │         80 │          620 │                25 │      885 │         56 │
│ maximum │       2370 │    1341 │      1262 │         81 │          631 │                26 │      887 │         57 │
│   stdev │         17 │      19 │        19 │          0 │           14 │                 1 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

(cherry picked from commit 9f36490)
Keno pushed a commit that referenced this pull request Jun 5, 2024
Using a work-stealing queue after Chase and Lev, optimized for
weak memory models by Le et al.

Default number of GC threads is half the number of compute threads.

Co-authored-by: Gabriel Baraldi <baraldigabriel@gmail.com>
Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
Drvi pushed a commit to RelationalAI/julia that referenced this pull request Jun 7, 2024
…alse-sharing (JuliaLang#52994)

For some reason this only shows up in the `many_refs.jl` benchmark,
since it's the only one that hammers the work-stealing queue (we also
didn't test this benchmark on a large number of GC threads in our
[previous
analysis](JuliaLang#48600 (comment))).

- master:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4268 │    3243 │      3048 │        194 │         1126 │                15 │      868 │         76 │
│  median │       4270 │    3246 │      3051 │        195 │         1128 │                17 │      868 │         76 │
│ maximum │       4278 │    3247 │      3052 │        195 │         1128 │                18 │      868 │         76 │
│   stdev │          5 │       2 │         2 │          0 │            1 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2728 │    1692 │      1551 │        141 │          598 │                23 │      868 │         62 │
│  median │       2732 │    1709 │      1567 │        141 │          603 │                23 │      868 │         62 │
│ maximum │       2744 │    1712 │      1571 │        143 │          607 │                24 │      868 │         63 │
│   stdev │          6 │       9 │         9 │          1 │            4 │                 0 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2105 │    1082 │       987 │         95 │          405 │                23 │      875 │         51 │
│  median │       2115 │    1089 │       994 │         95 │          409 │                23 │      875 │         52 │
│ maximum │       2127 │    1100 │      1003 │         97 │          417 │                25 │      875 │         52 │
│   stdev │          8 │       8 │         7 │          1 │            5 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       3861 │    2755 │      2676 │         79 │         1301 │                22 │      878 │         68 │
│  median │       3864 │    2835 │      2756 │         80 │         1342 │                25 │      879 │         73 │
│ maximum │       4032 │    2877 │      2797 │         80 │         1378 │                26 │      880 │         74 │
│   stdev │         73 │      45 │        45 │          1 │           28 │                 2 │        1 │          2 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       7455 │    6425 │      6344 │         80 │         3262 │                24 │      882 │         86 │
│  median │       7703 │    6682 │      6602 │         81 │         3313 │                25 │      884 │         87 │
│ maximum │       7826 │    6806 │      6725 │         81 │         3422 │                27 │      887 │         87 │
│   stdev │        152 │     153 │       153 │          0 │           68 │                 1 │        2 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

- PR:
```
bench = "many_refs.jl"
(gcthreads, threads) = (1, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       4264 │    3240 │      3048 │        192 │         1127 │                15 │      868 │         76 │
│  median │       4271 │    3244 │      3052 │        192 │         1129 │                17 │      868 │         76 │
│ maximum │       4514 │    3481 │      3289 │        193 │         1247 │                18 │      868 │         77 │
│   stdev │        109 │     106 │       106 │          0 │           53 │                 1 │        0 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (2, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2712 │    1680 │      1541 │        138 │          591 │                22 │      868 │         62 │
│  median │       2713 │    1691 │      1552 │        140 │          594 │                24 │      868 │         62 │
│ maximum │       2732 │    1710 │      1569 │        141 │          606 │                25 │      868 │         63 │
│   stdev │         11 │      12 │        12 │          1 │            6 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (4, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2090 │    1057 │       962 │         95 │          398 │                22 │      874 │         50 │
│  median │       2103 │    1070 │       974 │         95 │          401 │                24 │      874 │         51 │
│ maximum │       2140 │    1074 │       978 │         96 │          402 │                25 │      875 │         51 │
│   stdev │         19 │       6 │         6 │          0 │            1 │                 1 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (8, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2236 │    1208 │      1129 │         79 │          528 │                23 │      880 │         54 │
│  median │       2238 │    1214 │      1135 │         79 │          533 │                23 │      880 │         54 │
│ maximum │       2246 │    1218 │      1138 │         80 │          534 │                35 │      880 │         54 │
│   stdev │          4 │       4 │         4 │          0 │            3 │                 5 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
(gcthreads, threads) = (16, 1)
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ total time │ gc time │ mark time │ sweep time │ max GC pause │ time to safepoint │ max heap │ percent gc │
│         │         ms │      ms │        ms │         ms │           ms │                us │       MB │          % │
├─────────┼────────────┼─────────┼───────────┼────────────┼──────────────┼───────────────────┼──────────┼────────────┤
│ minimum │       2326 │    1297 │      1216 │         80 │          595 │                24 │      884 │         56 │
│  median │       2348 │    1325 │      1245 │         80 │          620 │                25 │      885 │         56 │
│ maximum │       2370 │    1341 │      1262 │         81 │          631 │                26 │      887 │         57 │
│   stdev │         17 │      19 │        19 │          0 │           14 │                 1 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
```

(cherry picked from commit 9f36490)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet