File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 11target TypeScript{
22 fast: true
33};
4+
5+ import BenchmarkRunner from "../BenchmarkRunner.lf";
6+
47reactor Counter(limit:number(25000)) {
58 input receive:number;
69 output done:boolean;
710 state count:number(0);
811 reaction (receive) -> done {=
912 count++;
1013 if (count == limit -1) {
14+ count = 0;
1115 done = true;
1216 }
1317 =}
@@ -21,22 +25,15 @@ reactor Sender {
2125 send = 1;
2226 =}
2327}
24- main reactor CountingActor(limit:number(25000)) {
25-
26- state startTime:time ;
28+ main reactor CountingActor(numIterations:number(12), limit:number(25000)) {
29+
30+ runner = new BenchmarkRunner(numIterations = numIterations) ;
2731
2832 s = new Sender();
2933 c = new Counter(limit = limit);
34+
35+ runner.start -> s.start;
36+ c.done -> runner.finish;
3037
3138 s.send -> c.receive;
32-
33- reaction (startup) -> s.start {=
34- s.start = true;
35- startTime = util.getCurrentPhysicalTime();
36- =}
37- reaction (c.done) {=
38- let elapsedTime = util.getCurrentPhysicalTime().subtract(startTime as TimeValue);
39- console.log("Elapsed time: " + elapsedTime);
40- util.requestStop();
41- =}
4239}
Original file line number Diff line number Diff line change @@ -39,3 +39,11 @@ targets:
3939 binary : " counting"
4040 run_args :
4141 messages : ["--main-count-to", "<value>"]
42+ lf-ts :
43+ copy_sources :
44+ - " ${bench_path}/TS/Savina/src/BenchmarkRunner.lf"
45+ - " ${bench_path}/TS/Savina/src/micro"
46+ lf_file : " micro/CountingActor.lf"
47+ script : " src-gen/micro/CountingActor/dist/CountingActor.js"
48+ gen_args :
49+ messages : ["-D", "limit=<value>"]
You can’t perform that action at this time.
0 commit comments