feat(benchmark): add comprehensive performance benchmarking system
🚀 Phase 8.2 PoC2 Achievement: 280x WASM performance boost proven\! ## New Features: - Complete benchmark framework (src/benchmarks.rs) - CLI integration: --benchmark --iterations options - 3-backend comparison: Interpreter/VM/WASM - Automated performance measurement & reporting ## Benchmark Results (100 iterations average): - WASM: 0.17ms (280x faster than Interpreter\!) - VM: 16.97ms (2.9x faster than Interpreter) - Interpreter: 48.59ms (baseline) ## Added Files: - benchmarks/bench_{light,medium,heavy}.nyash - Test cases - benchmark_summary_20250814.md - Clean results - wasm_demo/ - Browser execution environment ## Documentation Updates: - docs/execution-backends.md - Added benchmark usage - docs/CURRENT_TASK.md - Phase 8.3 Copilot coordination - CLAUDE.md - Quick benchmark access ## Copilot Integration Ready: - Phase 8.3 merge conflict avoidance strategy documented - Benchmark framework ready for Box operation performance validation - CLI integration preserved for future enhancements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
51
benchmarks/bench_medium.nyash
Normal file
51
benchmarks/bench_medium.nyash
Normal file
@ -0,0 +1,51 @@
|
||||
// Medium benchmark - more calculations
|
||||
static box Main {
|
||||
main() {
|
||||
local sum, temp, i
|
||||
sum = 0
|
||||
i = 1
|
||||
|
||||
// Manual "loop" - 10 iterations of calculations
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
i = i + 1
|
||||
|
||||
temp = i * 2 + 3
|
||||
sum = sum + temp
|
||||
|
||||
print(sum)
|
||||
return sum
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user