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.
| Stack | PHP | .wasm | Gzipped | vs php-8.6 |
|---|---|---|---|---|
php-8.6 | 8.6.0 | 8.7 MB | 3.1 MB | |
php-8.5 | 8.5.13 | 8.7 MB | 3.0 MB | -0.1 % |
php-8.4 | 8.4.28 | 7.5 MB | 2.8 MB | -14.2 % |
php-8.3 | 8.3.37 | 6.1 MB | 2.3 MB | -30.3 % |
php-8.6-intl | 8.6.0 | 41.9 MB | 16.4 MB | +379.8 % |
php-8.6-opcache-runtime | 8.6.0 | 8.7 MB | 3.1 MB | +0.0 % |
php-8.6-opcache-precompiled | 8.6.0 | 8.7 MB | 3.1 MB | +0.0 % |
example-playground | 8.6.0 | 19.8 MB | 7.4 MB | +126.6 % |
example-symfony | 8.6.0 | 30.6 MB | 7.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
-Ozinstead of-O2, PHP 8.5 and libxml2 make a.wasmfile 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.