aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-03-14 01:17:44 +0900
committernsfisis <nsfisis@gmail.com>2024-03-14 01:17:44 +0900
commitf4edb19f21c4777a95a5a8705d0e5f602103eb44 (patch)
treed6f7b6a9033767737d4eb7d16b7af007740bc420
parent9bf23e2abf74d70b77726a4300917c78bc8035e7 (diff)
downloadphp-waddiwasi-f4edb19f21c4777a95a5a8705d0e5f602103eb44.tar.gz
php-waddiwasi-f4edb19f21c4777a95a5a8705d0e5f602103eb44.tar.zst
php-waddiwasi-f4edb19f21c4777a95a5a8705d0e5f602103eb44.zip
perf: disable assertions
-rw-r--r--Makefile2
-rw-r--r--README.md2
-rw-r--r--benchmarks/20240314-0116.log4
-rw-r--r--prof.sh2
-rw-r--r--test.sh2
-rw-r--r--traces/20240314-0116.stderr.log8
6 files changed, 16 insertions, 4 deletions
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
+
+