Core-13 pure: add CI workflows, VM e2e tests, LLVM parity bridge (minimal); do not touch private docs
This commit is contained in:
17
benchmarks/bench_box_create_destroy.nyash
Normal file
17
benchmarks/bench_box_create_destroy.nyash
Normal file
@ -0,0 +1,17 @@
|
||||
// Interpreter-level microbench: Box create + drop inside loop
|
||||
static box Main {
|
||||
main() {
|
||||
local i = 0
|
||||
local total = 0
|
||||
loop(i < 1000000) { // 1e6 iterations
|
||||
{
|
||||
// tmp goes out of scope each iteration
|
||||
local tmp = new StringBox("x")
|
||||
total = total + tmp.length()
|
||||
}
|
||||
i = i + 1
|
||||
}
|
||||
return total
|
||||
}
|
||||
}
|
||||
|
||||
16
benchmarks/bench_box_create_destroy_small.nyash
Normal file
16
benchmarks/bench_box_create_destroy_small.nyash
Normal file
@ -0,0 +1,16 @@
|
||||
// Interpreter-level microbench: Box create + drop (small loops for time-boxed runs)
|
||||
static box Main {
|
||||
main() {
|
||||
local i = 0
|
||||
local total = 0
|
||||
loop(i < 10000) { // 1e4 iterations
|
||||
{
|
||||
local tmp = new StringBox("x")
|
||||
total = total + tmp.length()
|
||||
}
|
||||
i = i + 1
|
||||
}
|
||||
return total
|
||||
}
|
||||
}
|
||||
|
||||
14
benchmarks/bench_method_call_only.nyash
Normal file
14
benchmarks/bench_method_call_only.nyash
Normal file
@ -0,0 +1,14 @@
|
||||
// Interpreter-level microbench: method call on preallocated Box
|
||||
static box Main {
|
||||
main() {
|
||||
local i = 0
|
||||
local s = new StringBox("nyash")
|
||||
local total = 0
|
||||
loop(i < 2000000) { // 2e6 method calls
|
||||
total = total + s.length()
|
||||
i = i + 1
|
||||
}
|
||||
return total
|
||||
}
|
||||
}
|
||||
|
||||
13
benchmarks/bench_method_call_only_small.nyash
Normal file
13
benchmarks/bench_method_call_only_small.nyash
Normal file
@ -0,0 +1,13 @@
|
||||
// Interpreter-level microbench: method call only (small loop for time-boxed runs)
|
||||
static box Main {
|
||||
main() {
|
||||
local i = 0
|
||||
local s = new StringBox("nyash")
|
||||
local total = 0
|
||||
loop(i < 5000) { // 5e3 method calls per run (faster per-run)
|
||||
total = total + s.length()
|
||||
i = i + 1
|
||||
}
|
||||
return total
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user