mirror of
https://github.com/ocaml-multicore/eio.git
synced 2025-07-19 00:01:28 -04:00
Compare commits
No commits in common. "3fde20c16c3b712ccec32c02d0758032225f55b8" and "19c42eb7a4b763c6307ccf2400624eb25f9b732a" have entirely different histories.
3fde20c16c
...
19c42eb7a4
@ -1,26 +0,0 @@
|
|||||||
open Eio.Std
|
|
||||||
|
|
||||||
let ( / ) = Eio.Path.( / )
|
|
||||||
|
|
||||||
let n_stat = 100000
|
|
||||||
|
|
||||||
let run_fiber file =
|
|
||||||
for _ = 1 to n_stat do
|
|
||||||
let info = (Eio.File.stat file).kind in
|
|
||||||
assert (info = `Regular_file)
|
|
||||||
done
|
|
||||||
|
|
||||||
let run env =
|
|
||||||
Eio.Path.with_open_out ~create:(`If_missing 0o600) (env#cwd / "test-stat") @@ fun file ->
|
|
||||||
[1; 10] |> List.map (fun par ->
|
|
||||||
let t0 = Unix.gettimeofday () in
|
|
||||||
Switch.run (fun sw ->
|
|
||||||
for _ = 1 to par do
|
|
||||||
Fiber.fork ~sw (fun () -> run_fiber file)
|
|
||||||
done
|
|
||||||
);
|
|
||||||
let t1 = Unix.gettimeofday () in
|
|
||||||
let stat_per_s = float (n_stat * par) /. (t1 -. t0) in
|
|
||||||
let label = Printf.sprintf "n=%d fibers=%d" n_stat par in
|
|
||||||
Metric.create label (`Float stat_per_s) "stat/s" "Call fstat on an open file"
|
|
||||||
)
|
|
@ -9,7 +9,6 @@ let benchmarks = [
|
|||||||
"Stream", Bench_stream.run;
|
"Stream", Bench_stream.run;
|
||||||
"HTTP", Bench_http.run;
|
"HTTP", Bench_http.run;
|
||||||
"Eio_unix.Fd", Bench_fd.run;
|
"Eio_unix.Fd", Bench_fd.run;
|
||||||
"File.stat", Bench_fstat.run;
|
|
||||||
]
|
]
|
||||||
|
|
||||||
let usage_error () =
|
let usage_error () =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user