You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(database): create the checkpoint programs directory once per save
_save_program called os.makedirs(programs_dir, exist_ok=True) for every
program written, so a checkpoint at the default population_size=1000 created
the same directory 1,000 times. Create it once in save() and pass it down.
Also lift the log_prompts and prompts_by_program lookups out of the
per-program loop, and write each record with a single f.write(json.dumps(...))
rather than json.dump(..., f).
The bytes written are unchanged: checkpoints from an identical seeded
200-program population compare equal by SHA-256 before and after, both with
recorded prompts and without.
One save() call at the shipped defaults goes from 241.1829 ms to 182.8334 ms
of CPU, a 24.0% reduction, measured as the median of 5 repetitions on freshly
generated populations.
0 commit comments