-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
open Multicore_bench | ||
|
||
let run_one ~budgetf ~n_domains () = | ||
let n_bytes = 65536 in | ||
|
||
let init _ = | ||
let inn, out = Unix.pipe ~cloexec:true () in | ||
(inn, out, Bytes.create 1) | ||
in | ||
let work _ (inn, out, byte) = | ||
let n = Unix.write out (Bytes.create n_bytes) 0 n_bytes in | ||
assert (n = n_bytes); | ||
for _ = 1 to n_bytes do | ||
let n : int = Unix.read inn byte 0 1 in | ||
assert (n = 1) | ||
done; | ||
Unix.close inn; | ||
Unix.close out | ||
in | ||
|
||
let config = | ||
Printf.sprintf "%d worker%s" n_domains (if n_domains = 1 then "" else "s") | ||
in | ||
Times.record ~budgetf ~n_domains ~n_warmups:1 ~n_runs_min:1 ~init ~work () | ||
|> Times.to_thruput_metrics ~n:(n_bytes * n_domains) ~singular:"blocking read" | ||
~config | ||
|
||
let run_suite ~budgetf = | ||
[ 1; 2; 4 ] | ||
|> List.concat_map @@ fun n_domains -> | ||
if Sys.win32 || Domain.recommended_domain_count () < n_domains then [] | ||
else run_one ~budgetf ~n_domains () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ let () = | |
(libraries | ||
multicore-bench | ||
backoff | ||
unix | ||
multicore-magic |} | ||
^ maybe_domain_shims_and_threads ^ {| )) | ||
|} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters