# benchmark-phpef

Small PHPEF benchmark program used to exercise the PHPEF compiler/runtime pipeline with an external PHPEF library.

## Layout

- `src/main.php` — benchmark entry point; prints the `libpwcommon` copyright asset and runs the Fibonacci benchmark.
- `src/fibo.php` — benchmark implementation.
- `src/meson.build.pw` — declarative PHPEF build rule consumed by `pw-build-meson`.
- `meson.build` — project wrapper that runs `pw-build-meson` for `src/` and defines a smoke test.
- `tools/run_benchmark_smoke.sh` — verifies that the built binary starts, prints the common-library asset, completes the Fibonacci checks, and emits benchmark output.
- `build/` and generated `src/meson.build` — generated artifacts only; do not commit.

## Build

```sh
meson setup build --prefix=/usr
meson compile -C build
meson test -C build --print-errorlogs
```

`benchmark-phpef` depends on the installed PHPEF runtime stack and `pw-libs/libpwcommon`. When testing a fresh uninstalled RuntimeCore change, prepend its build directory to `LD_LIBRARY_PATH`, for example:

```sh
LD_LIBRARY_PATH=/home/peters/SVN/gentoo-pw-programs/a_phpef/phpef-runtime-core/build meson test -C build --print-errorlogs
```
