You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The largest files to load for the initial paint are:
wp.data – 13M – the WordPress installation and all its php files
php-web.wasm – 6.2M – the WebAssembly PHP build
wp.js – 182k – the emscripten-generated JS loader for wp.data
php-web.js – 153k – the emscripten-generated JS loader for php-web.wasm
php-webworker.js – 153k – same as above, but for the webworker backend
Let's shrink them as much as possible.
Here's a few ideas:
Minify the variable names in the PHP files
Minify the JSON files
Remove non-english translations
Identify PHP dependencies to remove, e.g. libxml2 doesn't seem necessary
libxml2 was removed from the default build in db0a477
Compress the .data and .wasm files using brotli compression – props to @eliot-akira. Edit: Web servers take care of it and most browsers support the brotli compression!
They recommend brotli compression, which produces the smallest file size compared to others (gzip or zopfli).
EDIT: Oops, never mind - this issue is about the file wp.data, which is not a WASM binary. Leaving the comment here anyway, the information could be useful elsewhere.
@eliot-akira I just played with brotli compression and the results are impressive:
php-web.wasm went from 6.2M to 1.5M (gzip gives 2.2M)
wp.data went from 13M to 3.3M (gzip gives 5.2M)
https://caniuse.com/brotli says it's supported on most major browsers – it shouldn't be that hard to serve brotli-compressed version of this files by default and offer a gzip fallback for unsupported browsers.
We're down to 3MB - 4MB for both php.wasm and wp.data! The actual bundles are about 15MB at the moment, but the webservers apply Brotli compression which dramatically reduces the amount of data transferred over the wire. Furthermore, #66 explores Brotli at JavaScript level to support non-webserver environments and more aggressive compression levels.
I'm going to close this issue for now, feel free to reopen at any point if needed.
Activity
adamziel commentedon Sep 2, 2022
The file extensions seen inside of the bundle are:
[-]Make the bundle smaller than 50mb[/-][+][Browser] Make the bundle smaller than 50mb[/+]eliot-akira commentedon Oct 3, 2022
Here's an idea I saw today in Golang's documentation about reducing the size of WASM files.
https://github.com/golang/go/wiki/WebAssembly#reducing-the-size-of-wasm-files
They recommend
brotlicompression, which produces the smallest file size compared to others (gzip or zopfli).EDIT: Oops, never mind - this issue is about the file
wp.data, which is not a WASM binary. Leaving the comment here anyway, the information could be useful elsewhere.Don't include static files in the build. (#43)
[-][Browser] Make the bundle smaller than 50mb[/-][+][Browser] Make the bundle smaller than 13M[/+][-][Browser] Make the bundle smaller than 13M[/-][+][Browser] Make the bundle smaller than 20M[/+]adamziel commentedon Oct 15, 2022
@eliot-akira I just played with brotli compression and the results are impressive:
php-web.wasmwent from 6.2M to 1.5M (gzip gives 2.2M)wp.datawent from 13M to 3.3M (gzip gives 5.2M)https://caniuse.com/brotli says it's supported on most major browsers – it shouldn't be that hard to serve brotli-compressed version of this files by default and offer a gzip fallback for unsupported browsers.
eliot-akira commentedon Oct 15, 2022
Cool! Glad the information about brotli turned out to be useful. Just saw PR #43, amazing.
[-][Browser] Make the bundle smaller than 20M[/-][+]Make the bundle smaller than 20M[/+]krishenriksen commentedon Nov 4, 2022
Brotli compress/decompress of php.wasm + wp.data
php.wasm - 1.58 MB
wp.data - 1.44 MB
#66
It loads fast enough now for you to even remove the Progress Bar.
adamziel commentedon Nov 23, 2022
We're down to 3MB - 4MB for both php.wasm and wp.data! The actual bundles are about 15MB at the moment, but the webservers apply Brotli compression which dramatically reduces the amount of data transferred over the wire. Furthermore, #66 explores Brotli at JavaScript level to support non-webserver environments and more aggressive compression levels.
I'm going to close this issue for now, feel free to reopen at any point if needed.
Update wp_http_fetch.php
Update wp_http_fetch.php (#1002)
Include the admin kitchen sink for import (#1475)
Build php-wasm with Emscripten 3.1.74 (#2)
Define `DB_NAME` constant when it's missing (#140)
[Website] Add standalone playground block demo page (#3071)
Fix auto-login on WordPress 1.0-2.5
[CLI] edit-markdown: switch to sqlite-markdown virtual tables (PHP-WA…