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:
@@ -0,0 +1,13 @@
|
||||
main() {
|
||||
var list = [];
|
||||
|
||||
Stopwatch watch = new Stopwatch();
|
||||
watch.start();
|
||||
for (var i = 0; i < 1000000; i++) list.add(i);
|
||||
|
||||
var sum = 0;
|
||||
for (i in list) sum += i;
|
||||
|
||||
print(sum);
|
||||
print("elapsed: ${watch.elapsedMilliseconds / 1000}");
|
||||
}
|
||||
Reference in New Issue
Block a user