Implement builtin benchmarks.

This commit is contained in:
Dmitry Atamanov
2023-08-28 10:31:05 +05:00
committed by Christoffer Lerno
parent 6ebb3caa20
commit b8c92c69b0
25 changed files with 339 additions and 38 deletions

View File

@@ -24,6 +24,7 @@ struct SubArrayStruct
usz len;
}
def BenchmarkFn = fn void!();
def TestFn = fn void!();
struct TestUnit
@@ -134,6 +135,16 @@ fn bool __run_default_test_runner()
};
}
fn bool __run_default_benchmark_runner()
{
BenchmarkFn[] fns = $$BENCHMARK_FNS;
String[] names = $$BENCHMARK_NAMES;
foreach (i, benchmark : fns)
{
io::printfn("Benchmark: %s %x.", names[i], fns[i]);
}
return true;
}
module std::core::runtime @if(WASM_NOLIBC);