From 7348999caf3ce1e0be64697319581d52f1d7f8ea Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 13 Mar 2024 22:12:59 +0900 Subject: perf: log instruction metrics --- examples/php-on-wasm/php-wasm.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/php-on-wasm/php-wasm.php') diff --git a/examples/php-on-wasm/php-wasm.php b/examples/php-on-wasm/php-wasm.php index 75e9c3f..b5a9fed 100644 --- a/examples/php-on-wasm/php-wasm.php +++ b/examples/php-on-wasm/php-wasm.php @@ -153,6 +153,10 @@ $exitCode = $result->inner->value; fprintf(STDERR, "Exit code: $exitCode\n"); fprintf(STDERR, "Memory peak usage: %s\n", memory_get_peak_usage()); +fprintf(STDERR, "\n\n"); +foreach ($runtime->getInstrMetrics() as $instr => $count) { + fprintf(STDERR, "%s: %d\n", $instr, $count); +} function allocateStringOnWasmMemory(Runtime $runtime, string $str): int { // Plus 1 for the null terminator in C. -- cgit v1.2.3-70-g09d2