Fil-C on Nix

Filnix wiki

mbrock/filnix

bench/php/default.nix

PHP 8.5 application benchmark: native Nixpkgs PHP against pkgsFilc.php85 (release Fil-C), pkgsFilcStaging.php85 (the staging toolchain) and pkgsFilcStaging.php85-jit (opcache's JIT through LLVM or C) on DokuWiki, MediaWiki and WordPress (see README.md).

λpkgs, pkgsFilc, pkgsFilcStaging
let
10filc=
pkgsFilc.php85
used by native zendBench

Nixpkgs' PHP at the Fil-C build's release, with its symbol tables kept so profiles resolve static functions as they do in the Fil-C build.

13native=
pkgs.php85.overrideinherit filc version; hash = filc.unwrapped.src.outputHash; packageOverrides = _: prev: extensions = builtins.mapAttrs_: e: if e ? overrideAttrs then e.overrideAttrsdoCheck = false; dontStrip = true; else e prev.extensions;;.overrideAttrs

Extension suites have timing- and CPU-affinity-sensitive tests (filter's OOM test, pcntl's affinity test) that failed on loaded builders, and they test nothing Fil-C-specific here.

34dontStrip=
true
35separateDebugInfo=
false
uses filc
37zendBench=
pkgs.runCommand"php-zend-bench.php" { }
tar xf ${filc.unwrapped.src} --wildcards '*/Zend/bench.php' -O > $out
uses filc
in
pkgs.writeShellApplication
42name=
"php-bench"
43runtimeInputs=
pkgs.python3 pkgs.perf pkgs.util-linux pkgs.nginx
49text=
export PHP_BENCH_NATIVE=${native} PHP_BENCH_FILC=${filc} \
PHP_BENCH_FILC_STAGING=${pkgsFilcStaging.php85} \
PHP_BENCH_FILC_STAGING_JIT=${pkgsFilcStaging.php85-jit} \
PHP_BENCH_DOKUWIKI=${pkgs.dokuwiki}/share/dokuwiki \
PHP_BENCH_MEDIAWIKI=${pkgs.mediawiki}/share/mediawiki \
PHP_BENCH_WORDPRESS=${pkgs.wordpress}/share/wordpress \
PHP_BENCH_WP_THEME=${pkgs.wordpressPackages.themes.twentytwentyfive} \
PHP_BENCH_WP_SQLITE=${pkgs.wordpressPackages.plugins.sqlite-database-integration} \
PHP_BENCH_ZEND=${zendBench} \
PHP_BENCH_MICRO=${./micro.php}
exec python3 -I ${./bench.py} "$@"