Skip to content

address a TODO in gc_sweep_page (i.e. save an unnecessary fetch-add)#54976

Merged
d-netto merged 1 commit intomasterfrom
dcn-save-fetch-add
Jun 29, 2024
Merged

address a TODO in gc_sweep_page (i.e. save an unnecessary fetch-add)#54976
d-netto merged 1 commit intomasterfrom
dcn-save-fetch-add

Conversation

@d-netto
Copy link
Copy Markdown
Member

@d-netto d-netto commented Jun 28, 2024

No description provided.

@d-netto d-netto added the GC Garbage collector label Jun 28, 2024
@d-netto
Copy link
Copy Markdown
Member Author

d-netto commented Jun 29, 2024

Benchmarks look fine:

  • master
category = "TimeZones"
bench = "TimeZones.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       2488 │     315 │       247 │         67 │          127 │                23 │     6976 │         13 │
│  median │       2494 │     316 │       249 │         67 │          130 │                25 │     6992 │         13 │
│ maximum │       2507 │     327 │       252 │         75 │          132 │                31 │     7006 │         13 │
│   stdev │          8 │       5 │         2 │          4 │            2 │                 3 │       12 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "append"
bench = "append.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        885 │     273 │       180 │         93 │           64 │                80 │     4036 │         30 │
│  median │        907 │     276 │       180 │         96 │           64 │                91 │     4036 │         31 │
│ maximum │        914 │     287 │       187 │        100 │           70 │               102 │     4036 │         31 │
│   stdev │         12 │       5 │         3 │          3 │            3 │                 9 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "big_arrays"
bench = "many_refs.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       1155 │     912 │       850 │         59 │          303 │                10 │      876 │         79 │
│  median │       1158 │     915 │       855 │         63 │          306 │                14 │      877 │         79 │
│ maximum │       1202 │     959 │       885 │         74 │          337 │                15 │      941 │         80 │
│   stdev │         20 │      20 │        14 │          6 │           15 │                 2 │       29 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "single_ref.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        490 │     343 │       333 │         10 │          125 │                15 │      875 │         69 │
│  median │        495 │     343 │       333 │         10 │          126 │                17 │      876 │         70 │
│ maximum │        500 │     353 │       344 │         10 │          132 │                19 │      877 │         71 │
│   stdev │          4 │       5 │         5 │          0 │            3 │                 2 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "bigint"
bench = "pollard.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        447 │     112 │       101 │         11 │           48 │                49 │      144 │         25 │
│  median │        450 │     114 │       103 │         11 │           48 │                55 │      146 │         25 │
│ maximum │        480 │     122 │       110 │         12 │           49 │                57 │      147 │         26 │
│   stdev │         14 │       4 │         4 │          0 │            0 │                 3 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "linked"
bench = "list.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       3251 │    2603 │      2355 │        246 │         1052 │                66 │     3329 │         80 │
│  median │       3255 │    2606 │      2360 │        248 │         1057 │                70 │     3330 │         80 │
│ maximum │       3417 │    2765 │      2501 │        264 │         1061 │                74 │     3338 │         81 │
│   stdev │         71 │      70 │        63 │          8 │            3 │                 3 │        4 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "tree.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       6329 │     375 │       368 │          7 │          291 │                23 │      196 │          6 │
│  median │       6343 │     378 │       371 │          7 │          296 │                25 │      196 │          6 │
│ maximum │       6462 │     384 │       377 │          7 │          298 │                26 │      196 │          6 │
│   stdev │         54 │       4 │         4 │          0 │            3 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "strings"
bench = "strings.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │      14578 │    2045 │      1840 │        205 │          715 │                75 │      762 │         14 │
│  median │      14765 │    2086 │      1880 │        206 │          720 │                83 │      770 │         14 │
│ maximum │      14819 │    2122 │      1914 │        207 │          729 │                89 │      774 │         14 │
│   stdev │        102 │      31 │        30 │          1 │            6 │                 5 │        5 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "big_arrays"
bench = "issue-52937.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       5300 │    1057 │       503 │        553 │           13 │             98496 │      168 │         20 │
│  median │       5391 │    1088 │       518 │        569 │           14 │            106752 │      168 │         20 │
│ maximum │       5493 │    1116 │       535 │        580 │           18 │            123012 │      170 │         20 │
│   stdev │         72 │      21 │        12 │         10 │            2 │              9310 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "objarray.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       6813 │    3942 │      2887 │       1040 │          601 │             17984 │     8434 │         58 │
│  median │       6957 │    4091 │      3011 │       1080 │          635 │             23820 │     9167 │         59 │
│ maximum │       7370 │    4517 │      3135 │       1382 │          906 │             24464 │     9599 │         61 │
│   stdev │        227 │     234 │        99 │        142 │          128 │              2816 │      514 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "binary_tree"
bench = "tree_immutable.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       2225 │    1222 │       658 │        544 │           35 │              4877 │      402 │         55 │
│  median │       2232 │    1253 │       694 │        558 │           37 │              4934 │      415 │         56 │
│ maximum │       2285 │    1305 │       717 │        598 │           42 │              5237 │      434 │         57 │
│   stdev │         26 │      31 │        23 │         24 │            2 │               156 │       12 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "tree_mutable.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       3910 │    2426 │      1070 │       1351 │           55 │              5823 │      675 │         62 │
│  median │       3938 │    2456 │      1096 │       1353 │           55 │              5915 │      700 │         63 │
│ maximum │       4081 │    2564 │      1130 │       1482 │           61 │              6105 │      727 │         63 │
│   stdev │         70 │      53 │        23 │         58 │            3 │               121 │       19 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "mergesort_parallel"
bench = "mergesort_parallel.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       2192 │     431 │       275 │        156 │           39 │              1352 │     1202 │         20 │
│  median │       2274 │     512 │       288 │        218 │           51 │              1421 │     1239 │         22 │
│ maximum │       2296 │     516 │       296 │        240 │           76 │              1650 │     1299 │         23 │
│   stdev │         40 │      36 │         9 │         33 │           16 │               117 │       37 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "mm_divide_and_conquer"
bench = "mm_divide_and_conquer.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        517 │      85 │        58 │         26 │           13 │             60152 │     2291 │         16 │
│  median │        518 │      88 │        61 │         26 │           13 │             61311 │     2499 │         17 │
│ maximum │        521 │      88 │        63 │         27 │           13 │             63946 │     2545 │         17 │
│   stdev │          1 │       2 │         2 │          0 │            0 │              1758 │      102 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
  • PR:
category = "TimeZones"
bench = "TimeZones.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       2486 │     314 │       247 │         67 │          129 │                23 │     6976 │         13 │
│  median │       2508 │     319 │       250 │         67 │          133 │                25 │     6994 │         13 │
│ maximum │       2616 │     330 │       255 │         80 │          134 │                31 │     7030 │         13 │
│   stdev │         53 │       6 │         3 │          6 │            2 │                 3 │       21 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "append"
bench = "append.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        892 │     275 │       180 │         92 │           64 │                82 │     4036 │         30 │
│  median │        900 │     275 │       181 │         95 │           65 │                85 │     4036 │         31 │
│ maximum │        911 │     285 │       184 │        104 │           70 │                92 │     4036 │         31 │
│   stdev │          8 │       5 │         1 │          5 │            3 │                 4 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "big_arrays"
bench = "many_refs.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       1168 │     926 │       849 │         74 │          325 │                12 │      940 │         79 │
│  median │       1171 │     928 │       851 │         76 │          326 │                13 │      941 │         79 │
│ maximum │       1181 │     933 │       859 │         80 │          331 │                14 │      941 │         79 │
│   stdev │          5 │       3 │         4 │          2 │            2 │                 1 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "single_ref.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        492 │     345 │       336 │         10 │          126 │                16 │      877 │         70 │
│  median │        539 │     392 │       380 │         12 │          128 │                19 │      941 │         73 │
│ maximum │        549 │     400 │       387 │         12 │          129 │                20 │      941 │         73 │
│   stdev │         27 │      26 │        25 │          1 │            1 │                 2 │       35 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "bigint"
bench = "pollard.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        457 │     117 │       105 │         11 │           47 │                44 │      144 │         24 │
│  median │        473 │     119 │       108 │         11 │           48 │                55 │      146 │         25 │
│ maximum │        487 │     123 │       111 │         12 │           49 │                59 │      147 │         26 │
│   stdev │         12 │       2 │         2 │          0 │            1 │                 6 │        1 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "linked"
bench = "list.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       3255 │    2605 │      2357 │        248 │         1049 │                62 │     3308 │         80 │
│  median │       3281 │    2634 │      2380 │        252 │         1055 │                67 │     3314 │         80 │
│ maximum │       3300 │    2650 │      2392 │        258 │         1067 │                71 │     3333 │         80 │
│   stdev │         16 │      17 │        14 │          4 │            7 │                 4 │       12 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "tree.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       6184 │     370 │       364 │          6 │          291 │                21 │      197 │          6 │
│  median │       6363 │     376 │       370 │          6 │          293 │                24 │      197 │          6 │
│ maximum │       6380 │     392 │       385 │          7 │          299 │                25 │      197 │          6 │
│   stdev │         82 │       9 │         9 │          0 │            3 │                 2 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "strings"
bench = "strings.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │      14485 │    2054 │      1849 │        204 │          707 │                82 │      759 │         14 │
│  median │      14573 │    2074 │      1868 │        205 │          723 │                84 │      765 │         14 │
│ maximum │      14722 │    2098 │      1890 │        208 │          734 │                90 │      772 │         14 │
│   stdev │        111 │      17 │        16 │          2 │           10 │                 3 │        6 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "big_arrays"
bench = "issue-52937.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       5177 │    1028 │       468 │        548 │           13 │            100500 │      168 │         20 │
│  median │       5219 │    1050 │       501 │        557 │           13 │            104284 │      169 │         20 │
│ maximum │       5312 │    1083 │       511 │        571 │           15 │            107824 │      169 │         20 │
│   stdev │         61 │      24 │        20 │          9 │            1 │              3066 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "objarray.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       6458 │    3590 │      2667 │        922 │          513 │             20857 │     7461 │         55 │
│  median │       6567 │    3731 │      2793 │        943 │          566 │             24721 │     8013 │         57 │
│ maximum │       7239 │    4391 │      3024 │       1367 │          881 │             39324 │     9842 │         61 │
│   stdev │        314 │     316 │       130 │        191 │          146 │              7495 │     1102 │          2 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "binary_tree"
bench = "tree_immutable.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       2251 │    1247 │       697 │        544 │           37 │              4484 │      384 │         55 │
│  median │       2287 │    1274 │       706 │        573 │           40 │              5001 │      417 │         56 │
│ maximum │       2296 │    1298 │       714 │        591 │           48 │              5068 │      447 │         57 │
│   stdev │         19 │      19 │         6 │         18 │            5 │               251 │       22 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
bench = "tree_mutable.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       3977 │    2466 │      1075 │       1355 │           57 │              5342 │      695 │         62 │
│  median │       3997 │    2491 │      1110 │       1394 │           58 │              5576 │      696 │         63 │
│ maximum │       4019 │    2542 │      1147 │       1415 │           59 │              5977 │      748 │         63 │
│   stdev │         16 │      28 │        26 │         23 │            1 │               252 │       23 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "mergesort_parallel"
bench = "mergesort_parallel.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │       2169 │     421 │       248 │        172 │           42 │              1322 │     1152 │         19 │
│  median │       2238 │     450 │       259 │        177 │           50 │              1370 │     1207 │         20 │
│ maximum │       2248 │     483 │       295 │        200 │           55 │              2834 │     1353 │         21 │
│   stdev │         33 │      26 │        19 │         12 │            6 │               653 │       84 │          1 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
category = "mm_divide_and_conquer"
bench = "mm_divide_and_conquer.jl"
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
[ Info: Setting GC memory pressure callback
┌─────────┬────────────┬─────────┬───────────┬────────────┬──────────────┬───────────────────┬──────────┬────────────┐
│         │ 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 │        515 │      84 │        59 │         25 │           12 │             58479 │     2402 │         16 │
│  median │        521 │      86 │        60 │         26 │           13 │             60495 │     2481 │         17 │
│ maximum │        535 │      89 │        64 │         27 │           14 │             63182 │     2509 │         17 │
│   stdev │          8 │       2 │         2 │          1 │            1 │              2091 │       52 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘

@d-netto
Copy link
Copy Markdown
Member Author

d-netto commented Jun 29, 2024

Also ran this sanity test:

using Printf

mutable struct ListNode
  key::Int64
  next::ListNode
  ListNode() = new()
  ListNode(x)= new(x)
  ListNode(x,y) = new(x,y);
end

function list(n=128)
    start::ListNode = ListNode(1)
    current::ListNode = start
    for i = 2:(n*1024^2)
        current = ListNode(i,current)
    end
    return current
end

l = list()
@printf "%d\n" @ccall jl_gc_pool_live_bytes()::Int64
GC.gc()
@printf "%d\n" @ccall jl_gc_pool_live_bytes()::Int64 # Should not change much after a GC

Results:

../julia-master/julia --gcthreads=1 quick_test.jl         
4304127584
4301681216
../julia-master/julia --gcthreads=8 quick_test.jl
4303631920
4301686648

@d-netto d-netto merged commit 41bde01 into master Jun 29, 2024
@d-netto d-netto deleted the dcn-save-fetch-add branch June 29, 2024 18:24
@PallHaraldsson
Copy link
Copy Markdown
Contributor

Should this be backported to 1.11 (and maybe 1.10)?

@oscardssmith
Copy link
Copy Markdown
Member

no. It's a simple perf improvement. No reason to backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GC Garbage collector

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants