test: use less aggressive numbers, my poor ram!

This commit is contained in:
Simon Cruanes 2023-07-10 00:01:37 -04:00
parent ab675797fa
commit b080c962e1
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
3 changed files with 7 additions and 5 deletions

View file

@ -7,7 +7,7 @@ let pool = Pool.create ~min:4 ()
let run () =
let t1 = Unix.gettimeofday () in
let n = 1_000_000 in
let n = 200_000 in
let n_tasks = 3 in
let task () =
let l = List.init n (fun x -> Fut.spawn ~on:pool (fun () -> x)) in

View file

@ -18,7 +18,9 @@ let () = assert (List.init 10 fib_direct = [ 1; 1; 2; 3; 5; 8; 13; 21; 34; 55 ])
let fib_40 : int =
let pool = Pool.create ~min:8 () in
fib ~on:pool 40 |> Fut.wait_block_exn
let r = fib ~on:pool 40 |> Fut.wait_block_exn in
Pool.shutdown pool;
r
let run_test () =
let pool = Pool.create ~min:8 () in
@ -28,12 +30,13 @@ let run_test () =
|> Fut.join_list |> Fut.wait_block_exn
= [ 1; 1; 2; 3; 5; 8; 13; 21; 34; 55 ]);
let fibs = Array.init 5 (fun _ -> fib ~on:pool 40) in
let n_fibs = 3 in
let fibs = Array.init n_fibs (fun _ -> fib ~on:pool 40) in
let res = Fut.join_array fibs |> Fut.wait_block in
Pool.shutdown pool;
assert (res = Ok (Array.make 5 fib_40))
assert (res = Ok (Array.make n_fibs fib_40))
let () =
Printf.printf "fib 40 = %d\n%!" fib_40;

View file

@ -65,7 +65,6 @@ let () =
(*
Tracy_client_trace.setup ();
*)
let start = Unix.gettimeofday () in
let n = try int_of_string (Sys.getenv "N") with _ -> default_n in
let j = try int_of_string (Sys.getenv "J") with _ -> 4 in