-
Notifications
You must be signed in to change notification settings - Fork 12
/
invocation.lox
73 lines (70 loc) · 1.15 KB
/
invocation.lox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// This benchmark stresses just method invocation.
class Foo {
method0() {}
method1() {}
method2() {}
method3() {}
method4() {}
method5() {}
method6() {}
method7() {}
method8() {}
method9() {}
method10() {}
method11() {}
method12() {}
method13() {}
method14() {}
method15() {}
method16() {}
method17() {}
method18() {}
method19() {}
method20() {}
method21() {}
method22() {}
method23() {}
method24() {}
method25() {}
method26() {}
method27() {}
method28() {}
method29() {}
}
var foo = Foo();
var start = clock();
var i = 0;
while (i < 500000) {
foo.method0();
foo.method1();
foo.method2();
foo.method3();
foo.method4();
foo.method5();
foo.method6();
foo.method7();
foo.method8();
foo.method9();
foo.method10();
foo.method11();
foo.method12();
foo.method13();
foo.method14();
foo.method15();
foo.method16();
foo.method17();
foo.method18();
foo.method19();
foo.method20();
foo.method21();
foo.method22();
foo.method23();
foo.method24();
foo.method25();
foo.method26();
foo.method27();
foo.method28();
foo.method29();
i = i + 1;
}
print clock() - start;