Remix.run Logo
yoav 5 days ago

Originally I had it going via browser -> postmessage -> zig -> bun via named pipes and then bun -> zig via named pipe -> js via evaluate js.

I’m building https://colab.sh/ with electrobun and that rpc was pretty slow when trying to load multi MB files in the code editor.

Last week I added an encrypted socket rpc option directly between bun and browser.

Loading a 2MB file went from a few seconds to 400ms.

I made it so that in contexts where CORS allows it automatically upgrades to the socket based faster RPC.

That’s via RPC though. electrobun also exposes a custom views:// scheme in the browser context that can load files directly from specific sandboxed places in the file system. More to improve there but for a very big file you’d be better off writing it to the file system that would be much faster.

thot_experiment 4 days ago | parent [-]

Sure but "fast communication" is always going to be prohibitively slow if you are used to "reading the same chunk of memory".

I don't really think that's an issue for the kinds of apps people use this sort of thing for and at first blush the IPC model here is at least better than Electron which is an absolute trash fire.