128 points · by ilkkao · 9y ago · 35 comments
The Electron team declined to support source code protection, judging it too difficult to implement. [0] NW.js supports the feature but with severe limitations that the Electron team understandably did not want to replicate. [1]
Roger Wang of NW.js fame recently tweeted that the NW.js implementation is about to get a whole lot better due to this new compiler landing in V8. [2]
Could this new development in V8 put source code protection back on the table for Electron? I posted this question to the official Electron discussion forums too a few days back, but I'd be curious to hear more input on the topic, thus posting it here as well. [3]
[0]: https://github.com/electron/electron/issues/3041
[1]: https://github.com/nwjs/nw.js/wiki/protect-javascript-source...
[2]: https://twitter.com/wwr/status/831691865850130432
[3]: https://discuss.atom.io/t/source-code-protection-via-new-v8-...
Source code protection amounts to bad DRM, and I should hope it doesn't need to explained on HN the ways DRM doesn't work.
Obviously no compilation process offers 100% protection, but it would be enough for most people's purposes if it occupied a space that was more secure (or more obfuscated) than Java, but less so than, say, C++.
To add to this since other people will come commenting, yes I know that if somebody REALLY wants to they can get to the code (although I'd argue that Denuvo worked for a while).
However there is a huge difference between having hard to read code that needs to be decompiled and unobfuscated to code that is in plain text! Any script kiddy can modify any electron application (The code is in freaking text files!).
Hopefully this will lead to many more simplifications in the future.
Does anyone know which optimizations finally catapulted Ignition+Turbofan ahead of FullCodeGen+Crankshaft in terms of performance?
https://twitter.com/bmeurer/status/834677090381348865
and
https://twitter.com/bmeurer/status/834668611180625921
the "Bazinga!" event in both cases refers to two very specific fixes that addressed deoptimization loops in TurboFan. The more interesting steady increase in performance is due to long-term real-world performance work, especially in the area of data-driven ICs (inline caches) and function context specialization.
We will follow up with more details about Ignition and TurboFan, and the whole new code generation architecture soon.
In any case, I'm looking forward to the more in depth post. :)
[0] is their current architecture. [1] will be the architecture after this change goes into effect.
It's a massive simplification which should allow them to implement new changes to the language much faster, improve memory usage and startup speed, and will allow them to tackle web assembly much easier!
Disclaimer: I work on the V8 team.
Apparently Ignition helps a bit, but still… even the baseline memory usage of Node.js and Chromium is bad. Just open a node REPL, its resident set size is 2x the size of a ruby/python REPL, about 10x the size of luajit.
https://docs.google.com/document/d/11T2CRex9hXxoJwbYqVQ32yIP...
Speaking very generally, I've never seen a major architecture change that led to a performance improvement across the board. In particular in JS which has so many corners. There are always going to be some things that improve, some that regress, and some that stay the same. You can see examples of all three here (compare lines with TurboFan+Ignition vs v8):
http://arewefastyet.com/#machine=29&view=breakdown&suite=oct...