Skip to content

Mark and sweep gc implementation.#89

Open
Pavel-Durov wants to merge 2 commits into
SOM-st:masterfrom
Pavel-Durov:mark-and-sweep-gc
Open

Mark and sweep gc implementation.#89
Pavel-Durov wants to merge 2 commits into
SOM-st:masterfrom
Pavel-Durov:mark-and-sweep-gc

Conversation

@Pavel-Durov

Copy link
Copy Markdown

Implemented mark-and-sweep GC as a non-moving, lazy, page-based collector.

On a 1MB heap it runs 1.03x – 1.51x the time of COPYING on the AWFY benchmarks.

The previous implementation (now preserved as DEBUG_MARK_SWEEP) was correct but slow - 1.36x–3.71x compared to COPYING on AWFY because it malloc/free every object, see #88.

AWFY benchmarks with default heap - 1MB

MARK_SWEEP runs 1.03x - 1.51x the time of COPYING.

confidence level: 99%

 Benchmark             COPYING (ms)  MARK_SWEEP (ms)  Ratio  Summary
 List/csom/1500         24823 ± 14    25467 ± 82   1.03  2.59% slower
 Richards/csom/100      70722 ±182    74650 ±214   1.06  5.55% slower
 Towers/csom/600        24359 ±121    27390 ±184   1.12  12.44% slower
 Queens/csom/1000       37391 ±147    42600 ±273   1.14  13.93% slower
 Bounce/csom/1500       30493 ± 87    35240 ±239   1.16  15.56% slower
 Permute/csom/1000      31329 ±471    36974 ±823   1.18  18.02% slower
 Sieve/csom/3000        52799 ±187    63303 ± 98   1.20  19.89% slower
 NBody/csom/250000      29889 ± 28    36533 ±148   1.22  22.23% slower
 Mandelbrot/csom/500    20259 ±438    25014 ±621   1.23  23.47% slower
 Json/csom/100          20732 ±276    26293 ±111   1.27  26.82% slower
 CD/csom/250            53464 ± 74    70570 ±425   1.32  31.99% slower
 Havlak/csom/1500       52799 ±666    70087 ± 79   1.33  32.74% slower
 Storage/csom/1000      27450 ±102    36770 ±158   1.34  33.95% slower
 DeltaBlue/csom/12000    8495 ± 16    12847 ± 64   1.51  51.22% slower

Comparing with a larger heap - 32MB

Here MARK_SWEEP runs 1.06x - 1.33x the time of COPYING.

confidence level: 99%

 Benchmark             COPYING (ms)  MARK_SWEEP (ms)  Ratio  Summary
 List/csom/1500          24445 ± 23    25921 ± 29   1.06  6.04% slower
 Richards/csom/100       64818 ± 72    75303 ±190   1.16  16.18% slower
 Towers/csom/600         23527 ± 53    28636 ±112   1.22  21.71% slower
 Havlak/csom/1500        52496 ±670    64347 ±270   1.23  22.57% slower
 CD/csom/250             43901 ± 45    53909 ±120   1.23  22.80% slower
 Json/csom/100           17387 ±113    21595 ± 47   1.24  24.20% slower
 Queens/csom/1000        35887 ±128    44660 ±306   1.24  24.44% slower
 Sieve/csom/3000         49827 ±114    62703 ± 43   1.26  25.84% slower
 DeltaBlue/csom/12000     8381 ± 39    10582 ± 57   1.26  26.27% slower
 Bounce/csom/1500        28609 ±214    36294 ± 93   1.27  26.86% slower
 NBody/csom/250000       28974 ±110    36908 ± 67   1.27  27.39% slower
 Mandelbrot/csom/500     19619 ±453    25076 ±691   1.28  27.81% slower
 Permute/csom/1000       29757 ±244    39437 ±561   1.33  32.53% slower
 Storage/csom/1000       22347 ±376    29783 ±185   1.33  33.27% slower

Implemented mark-and-sweep gc as a non-moving, lazy, page-based
collector. On a 1MB heap it runs 1.03x-1.51x the time of COPYING on
the AWFY benchmarks.

The previous implementation (now preserved as DEBUG_MARK_SWEEP) was
correct but slow - 1.36x-3.71x compared to COPYING on AWFY because
it malloc/free every object.
@Pavel-Durov

Copy link
Copy Markdown
Author

CI failures are due to networking error:

...
failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘apt.llvm.org’

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant