// Nyash simple benchmarks - just measure iterations without timer // How to run: // - Interpreter: ./target/release/nyash examples/ny_bench_simple.hako // - VM: ./target/release/nyash --backend vm examples/ny_bench_simple.hako // - VM+JIT (fast path!): NYASH_JIT_EXEC=1 NYASH_JIT_THRESHOLD=1 ./target/release/nyash --backend vm examples/ny_bench_simple.hako local ITER ITER = 100000 // change for heavier runs print("\n=== Nyash Simple Benchmarks (ITER=" + ITER + ") ===") // 1) Simple arithmetic loop: sum 0..ITER-1 local i, sum i = 0 sum = 0 loop(i < ITER) { sum = sum + i i = i + 1 } print("[arith_loop] sum = " + sum) // 2) Array push loop: push integers 0..ITER-1 local arr arr = new ArrayBox() i = 0 loop(i < ITER) { arr.push(i) i = i + 1 } print("[array_push] length = " + arr.length()) // 3) Mixed arithmetic: simple_add repeated local a, b, z a = 1 b = 2 i = 0 loop(i < ITER) { z = a + b a = a + 1 b = b + 1 i = i + 1 } print("[simple_add_loop] final z = " + z) print("\nDone.") return 0