Skip to content

Instantly share code, notes, and snippets.

View damiendoligez's full-sized avatar

Damien Doligez damiendoligez

View GitHub Profile
(* compile with:
ocamlfind opt -package unix,domainslib -linkpkg sorttest.ml
*)
module Timings = struct
type t = {
cpu_time : float;
wall_time : float
};;
@damiendoligez
damiendoligez / prombench.ml
Created April 9, 2024 12:50
Illustration of the spurious slice problem.
(* Author: Stephen Dolan *)
(* Modified by Damien Doligez *)
let large_allocs = true
let promotion_rate = 50
let collection_rate = 30
let ballast_mb = 100
let iters_m = 50
let rand =
@damiendoligez
damiendoligez / gc2.md
Created July 16, 2024 08:46
OCaml GC pacing, continued

[1] https://gist.github.com/stedolan/52c13d6b1a30276db31ca98683c8db16

Stephen Dolan suggested that we count only live data as sweeping work for the purpose of GC pacing. In other words, the work counter for sweeping is only incremented when we sweep a live block, not when we sweep a free block or a garbage block.

This is to improve the stability of the system by removing a feedback loop. If we count the whole heap size as sweeping work, then the GC speed depends on the heap size, which