feat: add wrenGetValueDouble API and benchmark for wrenCall() performance

Add a new public API function wrenGetValueDouble() to extract numeric values from WrenValue handles, with proper assertions for NULL and type checking. Introduce a comprehensive benchmark test for wrenCall() that measures invocation overhead by calling a foreign method 1,000,000 times across a separate VM instance, validating result correctness and reporting elapsed time. Include the benchmark script api_call.wren and register it in the Python benchmarking harness. Also fix minor assertion message typos in wren_vm.c for consistency.
This commit is contained in:
Bob Nystrom
2015-12-24 01:29:53 +00:00
parent 5865f534fc
commit 51bc3a828c
6 changed files with 76 additions and 3 deletions
+2
View File
@@ -51,6 +51,8 @@ def BENCHMARK(name, pattern):
regex = re.compile(pattern + "\n" + r"elapsed: (\d+\.\d+)", re.MULTILINE)
BENCHMARKS.append([name, regex, None])
BENCHMARK("api_call", "true")
BENCHMARK("api_foreign_method", "100000000")
BENCHMARK("binary_trees", """stretch tree of depth 13 check: -1