3 ms·
Why would Electron run anymore or less natively with this change?
by therealdrag0 6y ago
Why would Electron run anymore or less natively with this change?
- johncolanduoni 6y agoWithout this (assuming Rosetta 2 support was ironed out), the code generated by JITing JavaScript would also need to go through translation from x86 to ARM64.
- mcintyre1994 6y agoI’m guessing Electron apps worked without explicit support via Rosetta 2, but with explicit support the performance should be better. And - speculating - I’d guess that there’s quite a lot of code in Electron apps that isn’t AOTed by Rosetta, and that it would have more performance implications there than a native x86 Mac App would just because it has a lot of ongoing transpilation to do. With this change they can cut out Rosetta 2, and run direct on ARM.
- The_Colonel 6y agoThe problem is that Electron is essentially 2 big VMs - you can AOT the VM code, but not the code VMs produce. So yes, rosetta performance loss on electron apps would be significantly larger than on native x86 apps. (I'm probably going to find out since I don't plan to ship ARM build of my electron app)
- mcintyre1994 6y agoOut of interest how come you don't plan to ship an ARM build? I naively didn't really realise there were any tradeoffs for the developer here.
- The_Colonel 6y agoI'm not a mac user so I don't own one. Currently I cross compile Mac (and Windows) build on a linux machine and from time to time test those builds in a VM (not sure about the legality). I don't think this will be possible with ARM build - cross compilation probably won't be supported for ARM, I can't run ARM VM on my x86 dev machine, there's the new requirement for mandatory notarization (possible only on mac) ... maybe more but that's enough anyway.
- camhart 6y agoRosetta 2 is Apple's latest iteration of their Rosetta technology, which allows you to run x64 Intel applications on their new arm64 Apple Silicon hardware. Although we believe that x64 Electron apps will run under Rosetta 2, there are some important things to note (and reasons why you should ship a native arm64 binary). * Your app's performance will be significantly degraded. Electron / V8 uses JIT compilation for JavaScript, and due to how Rosetta works, you will effectively be running JIT twice (once in V8 and once in Rosetta). * You lose the benefit of new technology in Apple Silicon, such as the increased memory page size. * Did we mention that the performance will be significantly degraded? https://www.electronjs.org/blog/apple-silicon#what-about-rosetta-2 https://www.electronjs.org/blog/apple-silicon#what-about-ros...