From f4edb19f21c4777a95a5a8705d0e5f602103eb44 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 14 Mar 2024 01:17:44 +0900 Subject: perf: disable assertions --- Makefile | 2 +- README.md | 2 +- benchmarks/20240314-0116.log | 4 ++++ prof.sh | 2 +- test.sh | 2 +- traces/20240314-0116.stderr.log | 8 ++++++++ 6 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 benchmarks/20240314-0116.log create mode 100644 traces/20240314-0116.stderr.log diff --git a/Makefile b/Makefile index ee7c240..7d1cdb4 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ bench: .PHONY: run run: - php -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php + php -d zend.assertions=-1 -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php .PHONY: test test: diff --git a/README.md b/README.md index 56ed262..d606a55 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This is a WebAssembly runtime written in pure PHP. The PHP runtime can be compiled to WebAssembly binary. This Wasm runtime can execute it. Currently, "Hello, World!" program works on the PHP runtime on the Wasm runtime. ``` -$ php -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php +$ php -d zend.assertions=-1 -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php ``` diff --git a/benchmarks/20240314-0116.log b/benchmarks/20240314-0116.log new file mode 100644 index 0000000..7a11572 --- /dev/null +++ b/benchmarks/20240314-0116.log @@ -0,0 +1,4 @@ +Benchmark 1: make run + Time (mean ± σ): 3.513 s ± 0.021 s [User: 3.451 s, System: 0.062 s] + Range (min … max): 3.464 s … 3.543 s 10 runs + diff --git a/prof.sh b/prof.sh index 2d456e7..9fd164a 100644 --- a/prof.sh +++ b/prof.sh @@ -2,4 +2,4 @@ timestamp="$(date '+%Y%m%d-%H%M')" # php -d 'error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED' vendor/bin/reli inspector:trace -o traces/"$timestamp".log -- php -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php 2> traces/"$timestamp".stderr.log # vendor/bin/reli converter:flamegraph < traces/"$timestamp".log > traces/"$timestamp".svg -php -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php 2> traces/"$timestamp".stderr.log +php -d zend.assertions=-1 -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php 2> traces/"$timestamp".stderr.log diff --git a/test.sh b/test.sh index 81720c3..a87065a 100644 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ -result=$(php -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php 2>/dev/null) +result=$(php -d zend.assertions=-1 -d memory_limit=256M -d opcache.enable_cli=on -d opcache.jit=on -d opcache.jit_buffer_size=1G examples/php-on-wasm/php-wasm.php 2>/dev/null) if [[ "$result" == 'Hello, World!' ]]; then echo "Test passed" exit 0 diff --git a/traces/20240314-0116.stderr.log b/traces/20240314-0116.stderr.log new file mode 100644 index 0000000..fa04b0d --- /dev/null +++ b/traces/20240314-0116.stderr.log @@ -0,0 +1,8 @@ +Decoding... +Instantiating... +Executing... + +Exit code: 0 +Memory peak usage: 194434328 + + -- cgit v1.2.3-70-g09d2