Skip to content

Sizes

What each stack of this repository weighs: the .wasm file of its build for the web, and what a browser downloads, once gzipped, as GitHub Pages sends it. The extensions are what makes a build bigger, intl above all (see Supported extensions), and what is embedded, as the vendor/ of the Symfony example.

StackPHP.wasmGzippedvs php-8.6
php-8.68.6.08.7 MB3.1 MB
php-8.58.5.138.7 MB3.0 MB-0.1 %
php-8.48.4.287.5 MB2.8 MB-14.2 %
php-8.38.3.376.1 MB2.3 MB-30.3 %
php-8.6-intl8.6.041.9 MB16.4 MB+379.8 %
php-8.6-opcache-runtime8.6.08.7 MB3.1 MB+0.0 %
php-8.6-opcache-precompiled8.6.08.7 MB3.1 MB+0.0 %
example-playground8.6.019.8 MB7.4 MB+126.6 %
example-symfony8.6.030.6 MB7.2 MB+249.8 %

What weighs

  • Each branch of PHP is bigger than the one before, at the same extensions: the default stack is 26 KB bigger, gzipped, with PHP 8.6 than with PHP 8.5, 290 KB bigger than with PHP 8.4, and 810 KB bigger than with PHP 8.3. PHP 8.5 and later always build lexbor, uri and opcache (see Supported extensions).
  • With PHP 8.5, mbstring is 750 KB of the default stack, gzipped (see mbstring).
  • Half of what is gzipped is data, not code, and a compiler does not make data smaller. This is why there is no build argument to optimize for size: compiled with -Oz instead of -O2, PHP 8.5 and libxml2 make a .wasm file 10% smaller, and only 4% once gzipped.

castor site:build measures them when it builds this website. castor wasm:sizes gives them for what you built, and castor wasm:sizes --json as JSON.