I made a custom Linux image to run inside a web browser. No particular distro, just a Linux kernel (compiled with a custom configuration to produce a tiny binary), a shell, and a few small apps.
When reading from the filesystem, it made HTTP requests for each file (+ browser caching), so no need to load a disk image all at once. IIRC, I got the cold boot time down to <1 second (after assets were already cached from a previous load though).
I also got NixOS to run in the browser, but even after stripping out as much as possible, it was still really slow due to systemd. (I'm not a systemd hater, resources are just very limited when running this way.)
I used an x86 emulator called v86. It's a very cool project π