File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,35 @@ let run_suite ~budgetf:_ =
35
35
~trend: `Lower_is_better ~description: " Memory usage"
36
36
(`Float (Float. of_int (bytes / n)))
37
37
end;
38
+ begin
39
+ Scheduler. run @@ fun () ->
40
+ let open Picos_structured in
41
+ Bundle. join_after @@ fun bundle ->
42
+ let n = 10_000 in
43
+ let bytes =
44
+ measure_live_bytes @@ fun () ->
45
+ let main () =
46
+ while true do
47
+ Control. yield ()
48
+ done
49
+ in
50
+ for _ = 1 to n do
51
+ Bundle. fork_as_promise bundle main |> ignore
52
+ done ;
53
+ Control. yield ()
54
+ in
55
+ Bundle. terminate bundle;
56
+ Metric. make ~metric: " memory used" ~config: " promise in a bundle"
57
+ ~units: " B" ~trend: `Lower_is_better ~description: " Memory usage"
58
+ (`Float (Float. of_int (bytes / n)))
59
+ end;
38
60
begin
39
61
Scheduler. run @@ fun () ->
40
62
let open Picos in
41
63
let open Picos_sync in
42
64
let computation = Computation. create () in
65
+ let (Packed main) = Fiber. get_computation (Fiber. current () ) in
66
+ let _ = Computation. attach_canceler ~from: main ~into: computation in
43
67
let n = 10_000 in
44
68
let latch = Latch. create 1 in
45
69
let bytes =
You can’t perform that action at this time.
0 commit comments