Skip to content

Commit 6817b7d

Browse files
committed
Counting Benchmark (add runner)
1 parent 38fe10d commit 6817b7d

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
target TypeScript{
22
fast: true
33
};
4+
5+
import BenchmarkRunner from "../BenchmarkRunner.lf";
6+
47
reactor 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
}

runner/conf/benchmark/savina_micro_count.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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>"]

0 commit comments

Comments
 (0)