tweak: guess of chunk_size in Fork_join

This commit is contained in:
Simon Cruanes 2023-07-10 01:23:30 -04:00
parent 2326ae0078
commit f081c0f8ad
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -100,7 +100,7 @@ let for_ ?chunk_size n (f : int -> int -> unit) : unit =
| Some cs -> max 1 (min n cs)
| None ->
(* guess: try to have roughly one task per core *)
max 1 (n / Domain_.recommended_number ())
max 1 (1 + (n / D_pool_.n_domains ()))
in
let start_tasks ~run (suspension : Suspend_.suspension) =