This commit is contained in:
Simon Cruanes 2023-12-27 17:29:10 -05:00
parent bc92d97a76
commit eaa76ecb4c
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 7 additions and 4 deletions

View file

@ -14,6 +14,7 @@ let work ~dom_idx ~n () : unit =
(* Thread.delay 1e-6 *)
if dom_idx = 0 && _i mod 4096 = 0 then (
Trace_core.message "gc stats";
let stat = Gc.quick_stat () in
Trace_core.counter_float "gc.minor" (8. *. stat.minor_words);
Trace_core.counter_float "gc.major" (8. *. stat.major_words)

View file

@ -36,13 +36,15 @@ end = struct
mutable data: (string * user_data) list array;
}
let init_size_ = 1
let create () : t =
{
len = 0;
span = BA1.create BA.Int64 BA.C_layout 64;
start_time_ns = BA1.create BA.Int64 BA.C_layout 64;
name = Array.make 64 "";
data = Array.make 64 [];
span = BA1.create BA.Int64 BA.C_layout init_size_;
start_time_ns = BA1.create BA.Int64 BA.C_layout init_size_;
name = Array.make init_size_ "";
data = Array.make init_size_ [];
}
let[@inline] cap self = Array.length self.name