moved benchmark lox files to separate folder

This commit is contained in:
Moritz Gmeiner 2024-08-25 21:22:30 +02:00
commit 29431d0cdb
13 changed files with 344 additions and 302 deletions

73
benchmark/invocation.lox Normal file
View file

@ -0,0 +1,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;