Skip to content

Simplify sweeping of big values #54936

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

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Simplify sweeping of big values #54936

merged 2 commits into from
Jul 15, 2024

Conversation

d-netto
Copy link
Member

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

Simplifies the layout of the doubly linked list of big objects to make it a bit more canonical: let's just store a pointer to the previous element, instead of storing a "pointer to the next element of the previous element". This should make the implementation a bit easier to understand without incurring any memory overhead.

I ran the serial and multithreaded benchmarks from GCBenchmarks and this seems fairly close to performance neutral on my machine. We also ran our internal benchmarks on it at RAI and it looks fine from a correctness and performance point of view.

@d-netto d-netto added the GC Garbage collector label Jun 26, 2024
@d-netto d-netto requested review from vtjnash and gbaraldi June 26, 2024 02:57
@d-netto d-netto marked this pull request as draft June 26, 2024 03:06
@d-netto
Copy link
Member Author

d-netto commented Jun 26, 2024

Marking as draft until the x64 failure is investigated.

@d-netto d-netto force-pushed the dcn-sweep-bigvals branch 3 times, most recently from 8020759 to a271d93 Compare June 26, 2024 03:55
@gbaraldi
Copy link
Member

Btw, since you are changing this code, is the linked list an efficient enough data structure for this? I haven't measured the overhead of sweeping through this so I'm not sure but it's potentially a place where we spent some time pointer chasing.

@d-netto d-netto force-pushed the dcn-sweep-bigvals branch 17 times, most recently from 1b7041f to 3ad2b27 Compare June 27, 2024 14:56
@d-netto
Copy link
Member Author

d-netto commented Jun 27, 2024

is the linked list an efficient enough data structure for this

Probably?

Note that the sweeping code will need to access the GC bits in bigval_t and the next/prev pointers are in the same cache line as the GC bits, so manipulating the linked list will probably not incur that much extra cost in terms of cache misses.

@d-netto d-netto force-pushed the dcn-sweep-bigvals branch 3 times, most recently from f1c762c to 64b1fe4 Compare June 28, 2024 16:27
@d-netto d-netto force-pushed the dcn-sweep-bigvals branch 6 times, most recently from c5b9e75 to 4b333ab Compare July 10, 2024 18:34
@d-netto
Copy link
Member Author

d-netto commented Jul 10, 2024

Latest commit looks fine from a GC time perspective:

  • 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 │       2499 │     316 │       249 │         67 │          129 │                23 │     6977 │         13 │
│  median │       2504 │     319 │       251 │         67 │          130 │                24 │     6991 │         13 │
│ maximum │       2520 │     322 │       254 │         69 │          132 │                27 │     6997 │         13 │
│   stdev │          9 │       2 │         2 │          1 │            1 │                 2 │        9 │          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 │        848 │     272 │       179 │         90 │           64 │                81 │     4036 │         32 │
│  median │        854 │     273 │       181 │         92 │           65 │                86 │     4036 │         32 │
│ maximum │        859 │     275 │       182 │         96 │           67 │               101 │     4036 │         32 │
│   stdev │          4 │       2 │         1 │          2 │            1 │                 8 │        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 │       1120 │     884 │       825 │         58 │          291 │                12 │      875 │         79 │
│  median │       1132 │     893 │       834 │         59 │          298 │                13 │      876 │         79 │
│ maximum │       1156 │     909 │       850 │         60 │          301 │                18 │      877 │         79 │
│   stdev │         15 │      12 │        11 │          1 │            4 │                 3 │        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 │        479 │     343 │       333 │         10 │          126 │                17 │      875 │         71 │
│  median │        481 │     344 │       334 │         10 │          126 │                18 │      877 │         72 │
│ maximum │        491 │     353 │       344 │         10 │          131 │                26 │      877 │         72 │
│   stdev │          5 │       4 │         4 │          0 │            2 │                 4 │        1 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
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 │        445 │     112 │       101 │         11 │           48 │                50 │      145 │         24 │
│  median │        464 │     118 │       107 │         11 │           48 │                58 │      146 │         25 │
│ maximum │        479 │     119 │       107 │         11 │           50 │                63 │      147 │         26 │
│   stdev │         14 │       3 │         3 │          0 │            1 │                 5 │        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 │       3192 │    2540 │      2297 │        243 │         1030 │                65 │     3329 │         80 │
│  median │       3211 │    2564 │      2319 │        244 │         1035 │                69 │     3332 │         80 │
│ maximum │       3243 │    2590 │      2346 │        248 │         1038 │                81 │     3341 │         80 │
│   stdev │         19 │      18 │        18 │          2 │            3 │                 7 │        5 │          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 │       6283 │     377 │       370 │          6 │          294 │                21 │      196 │          6 │
│  median │       6299 │     382 │       376 │          6 │          298 │                23 │      197 │          6 │
│ maximum │       6335 │     388 │       382 │          7 │          301 │                28 │      197 │          6 │
│   stdev │         20 │       4 │         4 │          0 │            3 │                 3 │        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 │      14520 │    2047 │      1843 │        202 │          706 │                83 │      762 │         14 │
│  median │      14579 │    2086 │      1882 │        203 │          718 │                87 │      766 │         14 │
│ maximum │      14908 │    2103 │      1896 │        207 │          731 │               101 │      778 │         14 │
│   stdev │        156 │      26 │        24 │          2 │           10 │                 8 │        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 │       5201 │    1029 │       482 │        546 │           13 │             99714 │      168 │         19 │
│  median │       5291 │    1043 │       496 │        554 │           13 │            107124 │      169 │         20 │
│ maximum │       5344 │    1092 │       523 │        575 │           15 │            116900 │      170 │         21 │
│   stdev │         54 │      30 │        18 │         13 │            1 │              6214 │        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 │       6463 │    3654 │      2723 │        912 │          547 │             19917 │     7915 │         56 │
│  median │       6607 │    3824 │      2860 │        964 │          578 │             23196 │     8316 │         58 │
│ maximum │       6668 │    3839 │      2873 │        979 │          662 │             56026 │     9877 │         58 │
│   stdev │         93 │      96 │        70 │         28 │           45 │             15407 │      760 │          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 │       2264 │    1255 │       695 │        553 │           36 │              4454 │      381 │         55 │
│  median │       2289 │    1289 │       717 │        561 │           39 │              4787 │      411 │         56 │
│ maximum │       2296 │    1295 │       742 │        575 │           41 │              5243 │      418 │         57 │
│   stdev │         12 │      17 │        18 │          9 │            2 │               281 │       15 │          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 │       3918 │    2449 │      1116 │       1332 │           57 │              5403 │      695 │         62 │
│  median │       4005 │    2532 │      1144 │       1359 │           59 │              5865 │      707 │         63 │
│ maximum │       4056 │    2549 │      1199 │       1397 │           62 │              6031 │      736 │         63 │
│   stdev │         57 │      40 │        31 │         28 │            2 │               248 │       16 │          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 │       2185 │     448 │       273 │        175 │           52 │              1227 │     1235 │         21 │
│  median │       2250 │     504 │       285 │        209 │           55 │              1301 │     1249 │         22 │
│ maximum │       2260 │     528 │       318 │        218 │           79 │              1487 │     1336 │         23 │
│   stdev │         31 │      31 │        17 │         18 │           11 │               111 │       47 │          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 │        503 │      85 │        58 │         25 │           14 │             57337 │     2361 │         17 │
│  median │        507 │      86 │        61 │         26 │           15 │             59871 │     2379 │         17 │
│ maximum │        524 │      89 │        64 │         26 │           16 │             63875 │     2600 │         17 │
│   stdev │          8 │       2 │         2 │          0 │            1 │              2362 │      101 │          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 │       2490 │     322 │       247 │         73 │          135 │                19 │     6994 │         13 │
│  median │       2510 │     322 │       249 │         75 │          137 │                24 │     6999 │         13 │
│ maximum │       2525 │     329 │       254 │         75 │          139 │                25 │     7022 │         13 │
│   stdev │         12 │       3 │         3 │          1 │            1 │                 3 │       13 │          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 │        865 │     275 │       179 │         93 │           65 │                85 │     4036 │         32 │
│  median │        868 │     278 │       182 │         96 │           66 │                88 │     4036 │         32 │
│ maximum │        890 │     287 │       191 │         99 │           67 │               102 │     4036 │         32 │
│   stdev │         10 │       4 │         4 │          2 │            1 │                 7 │        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 │       1130 │     893 │       835 │         58 │          296 │                12 │      875 │         79 │
│  median │       1135 │     896 │       837 │         59 │          298 │                12 │      877 │         79 │
│ maximum │       1139 │     898 │       839 │         59 │          299 │                15 │      878 │         79 │
│   stdev │          4 │       2 │         2 │          0 │            1 │                 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 │        480 │     342 │       333 │         10 │          125 │                17 │      877 │         71 │
│  median │        481 │     346 │       336 │         10 │          127 │                19 │      877 │         72 │
│ maximum │        487 │     350 │       340 │         10 │          128 │                21 │      877 │         72 │
│   stdev │          3 │       3 │         3 │          0 │            1 │                 1 │        0 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘
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 │        463 │     116 │       105 │         11 │           47 │                47 │      145 │         25 │
│  median │        464 │     119 │       108 │         11 │           48 │                58 │      146 │         26 │
│ maximum │        475 │     119 │       108 │         11 │           49 │                64 │      147 │         26 │
│   stdev │          5 │       2 │         1 │          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 │       3219 │    2575 │      2334 │        242 │         1048 │                65 │     3328 │         80 │
│  median │       3233 │    2587 │      2344 │        244 │         1057 │                69 │     3331 │         80 │
│ maximum │       3244 │    2593 │      2348 │        246 │         1058 │                70 │     3334 │         80 │
│   stdev │          9 │       7 │         6 │          2 │            4 │                 2 │        2 │          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 │       6191 │     374 │       367 │          6 │          291 │                22 │      197 │          6 │
│  median │       6305 │     381 │       375 │          7 │          298 │                23 │      197 │          6 │
│ maximum │       6902 │     393 │       387 │          7 │          309 │                25 │      197 │          6 │
│   stdev │        285 │       8 │         8 │          0 │            7 │                 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 │      14558 │    2028 │      1826 │        201 │          717 │                82 │      757 │         14 │
│  median │      14672 │    2056 │      1852 │        203 │          722 │                88 │      764 │         14 │
│ maximum │      14877 │    2059 │      1854 │        205 │          728 │                93 │      767 │         14 │
│   stdev │        129 │      15 │        14 │          1 │            5 │                 5 │        4 │          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 │       5231 │    1062 │       505 │        548 │           15 │             99324 │      169 │         20 │
│  median │       5301 │    1068 │       514 │        552 │           16 │            102951 │      169 │         20 │
│ maximum │       5414 │    1111 │       545 │        578 │           18 │            110486 │      172 │         21 │
│   stdev │         69 │      21 │        15 │         13 │            1 │              4422 │        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 │       6437 │    3611 │      2681 │        931 │          527 │             17693 │     7887 │         55 │
│  median │       6670 │    3804 │      2842 │        962 │          596 │             21943 │     8247 │         58 │
│ maximum │       6858 │    3973 │      2987 │        986 │          676 │             59174 │    10130 │         59 │
│   stdev │        163 │     131 │       113 │         20 │           58 │             16963 │      899 │          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 │       2234 │    1247 │       655 │        558 │           36 │              4340 │      401 │         55 │
│  median │       2258 │    1268 │       709 │        566 │           38 │              4792 │      412 │         56 │
│ maximum │       2294 │    1276 │       714 │        592 │           39 │              4995 │      421 │         57 │
│   stdev │         23 │      13 │        25 │         13 │            1 │               259 │        8 │          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 │       3923 │    2437 │      1099 │       1324 │           56 │              5610 │      704 │         62 │
│  median │       4055 │    2503 │      1136 │       1380 │           57 │              5784 │      718 │         62 │
│ maximum │       4093 │    2590 │      1150 │       1453 │           59 │              5974 │      732 │         63 │
│   stdev │         71 │      57 │        21 │         48 │            1 │               129 │       11 │          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 │       2152 │     442 │       272 │        170 │           43 │              1129 │     1187 │         21 │
│  median │       2240 │     503 │       297 │        207 │           55 │              1332 │     1247 │         23 │
│ maximum │       2281 │     527 │       311 │        216 │           57 │              1785 │     1300 │         23 │
│   stdev │         51 │      33 │        15 │         18 │            6 │               244 │       48 │          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 │        501 │      87 │        60 │         25 │           12 │             56704 │     2238 │         17 │
│  median │        508 │      89 │        61 │         27 │           13 │             62814 │     2463 │         18 │
│ maximum │        512 │      90 │        65 │         28 │           13 │             66117 │     2545 │         18 │
│   stdev │          4 │       1 │         2 │          1 │            0 │              3691 │      117 │          0 │
└─────────┴────────────┴─────────┴───────────┴────────────┴──────────────┴───────────────────┴──────────┴────────────┘

@d-netto d-netto marked this pull request as ready for review July 10, 2024 19:04
@d-netto d-netto force-pushed the dcn-sweep-bigvals branch from 4b333ab to 1d67c6f Compare July 10, 2024 20:14
@d-netto
Copy link
Member Author

d-netto commented Jul 12, 2024

We also ran our internal benchmarks and it looks fine performance-wise.

Could you take a look at the PR @gbaraldi, @vtjnash?

@d-netto d-netto requested a review from kpamnany July 12, 2024 16:53
@d-netto d-netto force-pushed the dcn-sweep-bigvals branch 2 times, most recently from ca573db to 2ad22b9 Compare July 14, 2024 15:54
Copy link
Member

@kpamnany kpamnany left a comment

Choose a reason for hiding this comment

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

Nice. Some more comments would be great.

@d-netto d-netto force-pushed the dcn-sweep-bigvals branch from 9ac935c to 66fe70a Compare July 15, 2024 16:19
d-netto and others added 2 commits July 15, 2024 15:18
Co-authored-by: Kiran Pamnany <kpamnany@users.noreply.github.com>
@d-netto d-netto force-pushed the dcn-sweep-bigvals branch from 66fe70a to 31ccd72 Compare July 15, 2024 18:18
@d-netto d-netto merged commit f8bec45 into master Jul 15, 2024
7 checks passed
@d-netto d-netto deleted the dcn-sweep-bigvals branch July 15, 2024 22:20
d-netto added a commit that referenced this pull request Jul 16, 2024
They should have been deleted in
#54936, but were not.
d-netto added a commit to RelationalAI/julia that referenced this pull request Jul 22, 2024
Simplifies the layout of the doubly linked list of big objects to make
it a bit more canonical: let's just store a pointer to the previous
element, instead of storing a "pointer to the next element of the
previous element". This should make the implementation a bit easier to
understand without incurring any memory overhead.

I ran the serial and multithreaded benchmarks from GCBenchmarks and this
seems fairly close to performance neutral on my machine. We also ran our
internal benchmarks on it at RAI and it looks fine from a correctness
and performance point of view.

---------

Co-authored-by: Kiran Pamnany <kpamnany@users.noreply.github.com>
d-netto added a commit to RelationalAI/julia that referenced this pull request Jul 22, 2024
d-netto added a commit to RelationalAI/julia that referenced this pull request Jul 25, 2024
Simplifies the layout of the doubly linked list of big objects to make
it a bit more canonical: let's just store a pointer to the previous
element, instead of storing a "pointer to the next element of the
previous element". This should make the implementation a bit easier to
understand without incurring any memory overhead.

I ran the serial and multithreaded benchmarks from GCBenchmarks and this
seems fairly close to performance neutral on my machine. We also ran our
internal benchmarks on it at RAI and it looks fine from a correctness
and performance point of view.

---------

Co-authored-by: Kiran Pamnany <kpamnany@users.noreply.github.com>
d-netto added a commit to RelationalAI/julia that referenced this pull request Jul 25, 2024
nickrobinson251 pushed a commit to RelationalAI/julia that referenced this pull request Feb 26, 2025
Simplifies the layout of the doubly linked list of big objects to make
it a bit more canonical: let's just store a pointer to the previous
element, instead of storing a "pointer to the next element of the
previous element". This should make the implementation a bit easier to
understand without incurring any memory overhead.

I ran the serial and multithreaded benchmarks from GCBenchmarks and this
seems fairly close to performance neutral on my machine. We also ran our
internal benchmarks on it at RAI and it looks fine from a correctness
and performance point of view.

---------

Co-authored-by: Kiran Pamnany <kpamnany@users.noreply.github.com>
nickrobinson251 pushed a commit to RelationalAI/julia that referenced this pull request Feb 26, 2025
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