Phase 10_6b scheduler complete; 10_4 GC hooks + counting/strict tracing; 10_c minimal JIT path (i64/bool consts, binop/compare/return, hostcall opt-in); docs & examples; add Phase 10.7 roadmap (JIT branch wiring + minimal ABI).

This commit is contained in:
Moe Charm
2025-08-27 17:06:46 +09:00
parent de03514085
commit ddae7fe1fc
67 changed files with 4618 additions and 268 deletions

View File

@ -0,0 +1,46 @@
// Nyash simple benchmarks - just measure iterations without timer
// How to run:
// - Interpreter: ./target/release/nyash examples/ny_bench_simple.nyash
// - VM: ./target/release/nyash --backend vm examples/ny_bench_simple.nyash
// - VM+JIT (fast path!): NYASH_JIT_EXEC=1 NYASH_JIT_THRESHOLD=1 ./target/release/nyash --backend vm examples/ny_bench_simple.nyash
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