Skip to content

Commit 7ddcaa4

Browse files
Double sweep byte budget to preserve heap 1 behavior
Anchors the historical 2048/1024 slot counts on the 80-byte heap instead of the 40-byte heap. This isolates whether the major GC elimination seen in railsbench was caused by heap 1's halved budget in the previous commit.
1 parent 3938195 commit 7ddcaa4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

gc/default/default.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,12 @@ total_final_slots_count(rb_objspace_t *objspace)
10531053
* so larger slot pools (which are less heavily used) naturally get
10541054
* fewer slots swept per step.
10551055
*
1056-
* Baseline: 2048 slots * RVALUE_SLOT_SIZE = 2048 * 40 = 81920 bytes,
1057-
* preserving the historical behavior for the smallest heap.
1056+
* Baseline: preserves the historical sweep/pool slot counts (2048/1024)
1057+
* for the second heap (2 * RVALUE_SLOT_SIZE = 80 bytes). The smallest
1058+
* heap sweeps more per step (4096/2048 slots), larger heaps taper down.
10581059
*/
1059-
#define GC_INCREMENTAL_SWEEP_BYTES (2048 * RVALUE_SLOT_SIZE)
1060-
#define GC_INCREMENTAL_SWEEP_POOL_BYTES (1024 * RVALUE_SLOT_SIZE)
1060+
#define GC_INCREMENTAL_SWEEP_BYTES (2048 * RVALUE_SLOT_SIZE * 2)
1061+
#define GC_INCREMENTAL_SWEEP_POOL_BYTES (1024 * RVALUE_SLOT_SIZE * 2)
10611062
#define is_lazy_sweeping(objspace) (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(objspace))
10621063
/* In lazy sweeping or the previous incremental marking finished and did not yield a free page. */
10631064
#define needs_continue_sweeping(objspace, heap) \

0 commit comments

Comments
 (0)