Subject: bug#79074: 31.0.50; Increase gc-cons-percentage in Makefiles

From: Stefan Monnier <[email-masked]>
Date: Mon, 28 Jul 2025 13:07:51 -0400

> [...]
>> But if we do want to fine tune it, maybe it'd be worth re-running
>> Helmut's measurements for more values, like 0.8, 1, 1.25, 1.6, 2.0, 4.0
>> to have a more complete picture (I skipped the 2.5 and 3.2 steps because
>> I expect the difference between 2.0 and 4.0 will already show that this
>> is beyond the point of diminishing returns).
>
> That produces:
>
> | gc-cons-percentage |  elapsed |  rssmax |
> |--------------------+----------+---------|
> |                0.1 | 14:38.08 |  641880 |
> |               0.75 |  8:06.30 |  706240 |
> |                0.8 |  7:36.43 |  705732 |
> |                1.0 |  6:58.86 |  652292 |
> |               1.25 |  6:38.75 |  710320 |
> |                1.5 |  6:32.58 |  766348 |
> |                1.6 |  6:14.64 |  776856 |
> |                2.0 |  5:57.64 | 4655076 |
> |                4.0 |  6:08.25 | 4652808 |
>
> Not sure why there is this sudden jump for rssmax in the 2.0 row; it
> looks strangely non-linear.

The impact on the memory use depends on things like fragmentation,
blocks of code where we inhibit GC, and could also interact with the
conservative scanning of the stack (a larger heap increases the
likelihood of finding false positives), so I'm not completely surprised
there are non-linearities.

> Other than that, it looks like gc-cons-percentage = 1.0 is
> a reasonable choice.

Your data shows that 1.0 is not a terrible choice and that it is on the
conservative side (based on your data, a choice like 1.6 would be
closer to my idea of "optimal"), so all in all, I think it matches our
goal fairly well.  🙂

> The same as boxplot:
>
> The "without outliers" variants show the data without the dots above the
> whiskers.  The whiskers are at 1.5 * interquartile-range.

Thanks.  I guess the outliers do illustrate the risks involved in
setting that tunable "too high".

I'm surprised q75 for rssmax is (ever so slightly) lower for 4.0 than
for 2.0.

        Stefan