Hacker News new | past | comments | ask | show | jobs | submit login

The document is rendered with WebGL on the canvas but the UI around it (layers panel, properties panel) is React. Not to mention a lot of other business logic for things like permissions that’s shared with the rest of the fullstack app. So either way you need some sort of browser engine.

If you use the native webview, it’ll probably use less memory but be slower because it’s basically running Safari instead of Chrome. It’s probably the wrong tradeoff for Figma because the browser’s memory usage and JS heap memory is pretty negligible compared to the amount of memory the user’s document uses, especially large ones with a lot of images. There’s way more room for optimization there and that has nothing to do with Electron.

It’s fun to think about what the performance would be if it was 100% C++ given infinite resources but realistically it’d be way less productive and more bug prone than React. I’ve written UIs in C++ before,would not repeat. That time would be better spent optimizing actual bottlenecks, like rendering the design file (where the GPU is the bottlebeck).

We actually have a native (not WASM) with native webview build we use internally for debugging with XCode. No, performance isn’t better enough to warrant dealing with Safari issues and shipping that over the Electron + WASM build.




Thanks for the detailed answer! That all makes sense, I actually saw one of your engineers present at a conference a few years ago and was really impressed. The tech blog is also fascinating to read.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: