feat: add Dart benchmarks for binary_trees, delta_blue, fib, for, and method_call

Add five new Dart benchmark implementations (binary_trees, delta_blue, fib, for, method_call) under test/benchmark/ and register the Dart runner using the fletch runtime in util/benchmark.py. The benchmarks are ported from existing Wren and JavaScript versions, covering tree traversal, constraint solving, recursive Fibonacci, loop performance, and method call overhead.
This commit is contained in:
Bob Nystrom
2015-12-05 19:09:30 +00:00
parent a5d08effea
commit 320c804ecf
7 changed files with 917 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
fib(n) {
if (n < 2) return n;
return fib(n - 1) + fib(n - 2);
}
main() {
Stopwatch watch = new Stopwatch();
watch.start();
for (var i = 0; i < 5; i++) {
print(fib(28));
}
print("elapsed: ${watch.elapsedMilliseconds / 1000}");
}