Remix.run Logo
bobajeff 5 days ago

>Security and Performance with isolation between the main and webview processes

That's one of the performance characteristics I'm afraid will hinder certain applications.

It sounds like you need to use a IPC bridge to share data between the main process and renderor. Which means copying all the shared data. Like if I wanted to use ffmpeg for decoding video then each frame I'm waiting for a the decoded image to be copied before rendering it.

yoav 5 days ago | parent | next [-]

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.

afavour 5 days ago | parent | prev [-]

Eh, it’ll hinder certain applications but very few, really. Assuming the webview is intended for UI and very little else.