mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
remove tracy from t_bench1
This commit is contained in:
parent
4e321b9c46
commit
7005e114d1
2 changed files with 4 additions and 16 deletions
|
|
@ -1,3 +1,3 @@
|
||||||
(tests
|
(tests
|
||||||
(names t_fib t_bench1)
|
(names t_fib t_bench1)
|
||||||
(libraries moonpool tracy tracy-client))
|
(libraries moonpool))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
open Moonpool
|
open Moonpool
|
||||||
|
|
||||||
let ( let@ ) = ( @@ )
|
|
||||||
|
|
||||||
let rec fib x =
|
let rec fib x =
|
||||||
if x <= 1 then
|
if x <= 1 then
|
||||||
1
|
1
|
||||||
|
|
@ -10,21 +8,12 @@ let rec fib x =
|
||||||
|
|
||||||
let run ~psize ~n ~j () : _ Fut.t =
|
let run ~psize ~n ~j () : _ Fut.t =
|
||||||
Printf.printf "pool size=%d, n=%d, j=%d\n%!" psize n j;
|
Printf.printf "pool size=%d, n=%d, j=%d\n%!" psize n j;
|
||||||
let pool =
|
let pool = Pool.create ~min:psize ~per_domain:0 () in
|
||||||
Pool.create
|
|
||||||
~on_init_thread:(fun ~dom_id:_ ~t_id () ->
|
|
||||||
Tracy.name_thread (Printf.sprintf "t_%d" t_id))
|
|
||||||
~min:psize ~per_domain:0 ()
|
|
||||||
in
|
|
||||||
|
|
||||||
|
(* TODO: a ppx for tracy so we can use instrumentation *)
|
||||||
let loop () =
|
let loop () =
|
||||||
let@ _sp = Tracy.with_ ~file:__FILE__ ~line:__LINE__ ~name:"loop" () in
|
|
||||||
for _i = 1 to n do
|
for _i = 1 to n do
|
||||||
let () =
|
let () = ignore (Sys.opaque_identity (fib 30) : int) in
|
||||||
let@ _sp = Tracy.with_ ~file:__FILE__ ~line:__LINE__ ~name:"iter" () in
|
|
||||||
Tracy.add_text _sp (string_of_int _i);
|
|
||||||
ignore (Sys.opaque_identity (fib 30) : int)
|
|
||||||
in
|
|
||||||
|
|
||||||
Thread.yield ()
|
Thread.yield ()
|
||||||
done
|
done
|
||||||
|
|
@ -34,7 +23,6 @@ let run ~psize ~n ~j () : _ Fut.t =
|
||||||
fut
|
fut
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
Tracy.enable ();
|
|
||||||
let j = ref 10 in
|
let j = ref 10 in
|
||||||
let n = ref 10 in
|
let n = ref 10 in
|
||||||
let psize = ref 4 in
|
let psize = ref 4 in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue