by milankragujevic · 8y ago · 0 comments
Nowhere is Electron mentioned and still comes the hate. A close friend of mine (not a web-developer, unlike me) has a very popular app (>10K users) which uses Electron and he got only around 30 performance complaints last year and all of them could be solved without rewriting the damn thing. The app has a giant "Feedback" button in the main view and there are at least 10 bug reports / suggestions per day (I manage the support desk).
This is getting to the levels of this silly Java hate because everyone thought the performance of Eclipse from years ago still is the state-of-the-art for Java development. There are many bad electron-based apps, that is for sure and completely normal because the barrier to entry is so low. Yeah and there is Slack, but don't complain if you gave up IRC for that incompatible piece of... Whatever.
Sorry for the rant.
- uses more RAM than an electron app
- takes up more disk space than an electron app
- looks no more native than an electron app
- resizing is jankier than an electron app
So where are the advantages again?
I previously use [CMD Markdown](https://www.zybuluo.com/mdeditor) to edit notes, which is developed in Electron. It is really painful to alternate between multiple note tabs in it.
VNote is faster though it combines C++ and JS via QWebEngineView.
I keep on seeing people complaining about Electron here, but it's brought about an age of hundreds of thousands of applications that have compatibility across OS' to do very specific tasks.
I just feel that the ~80MB memory usage and large file size (30-60MB) is inconsequential in modern computing.
Resource usage can be justified if the that resources is used toward something meaningful. C is "slower" than assembly, yes; however both assembly can be inlined into C, and magnitudes more can be done with C at near-assembly speeds.
I develop in C/C++/Python mainly and in some other languages for fun and curiosity. Python is easy, but it's not as performant unless the underlying library is native, hence nobody is using it if it can't obtain very high performance in my field (scientific computing, HPC, and related areas).
Actually, writing a low performance GUI is pretty hard since most of its cycles are idle. If you can write an application with a GUI which slow to respond to low-complexity, common tasks (naive text editing, input, menus, moving windows), something is very, very wrong (to be clear, GUI can trigger resource intensive background tasks, but that's not what I'm saying).
Performance in Electron-based editors (e.g., Atom) is horrible. When you're used to vim or fast GUI-based editors like Sublime, even typing in Atom feels sluggish. That's not even talking about loading large files, search-and-replace operations, multiple cursors, etc.
Example stats: https://blog.xinhong.me/post/sublime-text-vs-vscode-vs-atom-...
Quantity over quality seems to be the recent trend.
The general reason for the performance of C/C++ apps is that the language forces you to care about your memory usage. The lack of a garbage collector ensures that you think twice about what memory you allocate and free. Someone with a background in c/c++ will write efficient electron apps. Their past experience ensures that they reflexively write good code.
I wrote an electron based music player that uses less memory than a native player developed in c# that i wanted to replace. I spend an hour reviewing and profiling every feature that I add to ensure that i am not wasting memory. And it shows.
People need to understand that it is not the platform that is slow. It is the stupid code that you write without a thought that is the problem.