Should I use multiple threads for parallel GC with otherwise sequential code?

As Julia v10 has added parallel GC, is it advisable to use multiple threads with the -t command line option of julia even if the code to be run is non-parallel? Is there any possible performance regression compared with single-threaded GC?

In general multithreaded GC will often speed up single threaded programs, although in 1.10 there are a few places (place work-stealing queue indices on different cache lines to avoid false-sharing by d-netto · Pull Request #52994 · JuliaLang/julia · GitHub) where multithreaded GC causes regressions that will be fixed in 1.10.1

4 Likes