Medium: Electron is Cancer

I have access to a lot of stuff on Linux that I wouldn’t otherwise…and a lot of RAM.

Same here, I have 32gb RAM but I checked few times and it seems my Atom is not as memory hungry as mentioned by others.

On the other hand its OS support and extendability are really cool. Not being a fan of JS I can’t ignore that it has the most UI tools today and one can consider Desktop as just another front end, so the whole idea of using JS to develop it is not that weird.

Eh, I actually spend most of my time in consoles, I LOVE terminal apps, terminal chat apps, terminal browser (mostly elinks), etc… I hate electron in most of my time. ^.^;

That really sounds like some bad C++ programming, first of all WAY too many programmers, like what the frick I have to ask?! o.O

I’d bet the programmer count alone was the primary contributer to what went wrong there. Second is that the QT API is even easier in C++ than in Python (I say anyway, it catches most communication bugs where the python versions do not except at runtime). QT is really easy, I think it’s API has some issues, but it is one of the if not the best multi-platform GUI’s (even maybe of non-multi-platform) out. A fantastic mix of power and speed both (though that moc tool needs to die off already, there is no point to it anymore…).

Java is not a bad multi-platform decently-fast language either, the huge runtime that you have to install sucks, but at least it is done once unlike electron apps, and JavaFX (the GUI system in modern Java’s) is actually pretty awesome! ^.^

I just consider those that do not want to advanced and learn (even outside of work) as those not worth working with, though I may be biased as I do teacher’y things in real life… >.>

OgodsIFeelForYou…

I prefer to break up C++ apps into more smaller dependencies (and use CMake’s Hunter.sh Dependency Management System to bring it all together). That size alone would make me rip it into pieces as quick as I could… >.>

Uh, what?

In Windows here at work right now at this very moment:

  • Slack: 553,616 KB
  • Discord: 201,220 KB
  • Windows Calculator Application: 32176 KB (the heck for a calculator app, stupid .NET programs…)
  • Chrome: Over 7 gigs
  • Atom: I’m not loading this right now, not enough free RAM… >.>

I’m thinking you did not look at the committed memory to things like Slack and so forth, you appear to be WAY off…

Electron honestly is not ‘that’ bad, just most javascript programmers are not good programmers and do not know more of the details of the system they are programming for.

I’d use QT, for native GUI’s I do not consider that there are really any other options, QT is just awesome, and there are TONS of language bindings (I’ve even seen javascript ones somewhere), or just use QTQuick2+ (part of QT) that is basically javascript scripting of the GUI’s (bound to another language’s components though).

Like egads GTK-anything sucks. I really really dislike the GTK GUI kit, it is a model of misdesign in so many ways… >.>

I still don’t see what is native about react native, it still seems it is running in a javascript sandbox, which is quite the opposite of native…

Kotlin has some great interfaces to JavaFX!

That’s it, I bet they did not calculate it properly.

It’s not that it is actually compressed, but rather it is unloaded (paged out, in addition to being compressed).

I’ve seen one for QT somewhere as I recall, forget where. Or just use QTQuick2+ straight for the raw-GUI part (using a better language for the actual work).

That’s the problem, you should use the windows performance, er, whatever it’s called, it gets you more information.

Electron is basically Chrome(ium) you do know yes? Just restricted to one tab. And Chrome(ium) is an engine that hosts a javascript sandbox, crazy-complex (overly so) rendering engine, etc…

Sure they could use native languages. Any developer worth anything at all can pick up any other language with relative ease, it is the API’s that take up most of the learning time, not the concepts, and if you know, say, QT, then it has a similar API in a dozen languages it works with.

Seem pretty easy to me, could just use PyQT to whip up things even faster than Electron even. ^.^

Hmm, I think you’d prefer to learn Haxe then. It compiles to more languages than about any other that I’ve ever heard of, including it can compile to C++, Java, Javascript, and over a dozen other things. You could use it as the front-end language to compile to tons of other things, and Haxe has been around for over a decade and has a rather large community with tons of bindings. :slight_smile:

Yeah like I keep trying IntelliJ, but it is just so memory hungry and has *so*many* freezes that I just keep going back to KDevelop for my C++ work. KDevelop is a fantastic C++ IDE and I wish more language IDE’s were like it.

I don’t, I only have 16 gigs at home and my motherboard is maxed out… >.>

8gigs at work…

Hmmm…

Tasks: 892, 4340 thr; 8 running
Load average: 0.88 0.99 0.95
Uptime 107 days(!), 23:55;44

So… yeah I have a LOT of running things on my desktop computer… I’m also using 12.9G out of 16G(15.7G) of RAM and 13.2G of 16G of Swp… >.>
Most of it is Chrome… Though I do have about 15-20 apps I routinely use in a given hour, sometimes more.

Actually you probably would. The BEAM is actually quite well optimized because it is a more limited language than javascript (not less capable, just limited dynamism, which allows it to be quite faster for a lot of work).

And there are GUI programs written on the BEAM, other than built-in ones like Observer, there are also standalone programs like the free 3D Modeler (yes, a 3D Modeler written in Erlang) called Wings3D.

I feel a twinge of horror when I see another electron app because that means it is not going to be using my native GUI’s, native GUI coloring, native notifications, will not have a commandline interface (it’s possible to do it, but I’ve not seen any electron app actually do it yet), etc…

It’s just reskinned Chrome(ium).

Uh what? I’ve never had such issues in QT. That sounds like the developers had no clue what they were doing, not at all ‘competent’ by any stretch.

Qt actually has some fantastic threading primitives, workers, etc… Again, what?! o.O

Qt actually does a lot to make more code ‘faster’ than the equivalent native OS calls that most people would write. Again this sounds like the programmers did not know what they were doing…

Atom is only eating ~200megs here right now. I notice it tends to really fail over bad when opening big files with lots of, say, syntax coloring or so, then it get eat multiple gigs pretty easily. That is more of a fault of it being an embedded web browser and using a costly DOM than really the coding fault in this case though (VSCode has similar issues).

Except that ‘Javascript The Language’ is bad in general, though that is the place for another thread/rant. :wink:

Ending…

However, overall I don’t think electron itself is bad, just that, hmm, 99% of the code written on top of it is utter crap, and although javascript helps and encourages developers to write bad code instead of good code, you don’t have to write bad code in javascript, just that most coders are not knowledgeable enough to write half-decent code (‘ooo let’s copy-paste this from stack overflow, yay done!’).

3 Likes

yes, I agree here, I also think it’s bad. My point is that this bad language already got many good tools to build UIs that better languages will not have any time soon

Agree with just about everything said, except QT although it is indeed very easy especially with QT quick, is expenseive if going to release as a solo developer (last time I checked license fee was like 500 a month or something, pretty big overhead for a lone dev). So, I’d preface that with if we are talking about Open Source :wink:

Their license structure is a bit confusing so I may have got that wrong… (Hopefully I am wrong :slight_smile: , please correct me if I am)

No it’s not.

It is lgpl, so just dynamically link to it. Or release your source, whichever.

1 Like

And one thing I remembered now, somehow all those Electron apps installers, when on windows, try to kill my small SSD system drive :rolling_eyes: They won’t let me choose where do I want to install it, and they put themselves into C:\Users\__USER__\AppData\Local\__APP_NAME__. How the hell we came back from times when every windows app asked you where do you want to install it, to some bullshit “one-click-I-kill-your-system-drive-installers”? That really pisses me off. Even Steam ask you where to install before every game installation.

2 Likes

Not to ask where to install is the fault of the installers, not having moved Users to a magnetic drive is yours… Its commonly a high frequent write folder and as such has nothing to search on an SSD… At least thats my opinion…

1 Like

There seems to be a certain obsession with one-click installers in the Electron community. Not only the officially supported/suggested Squirrel installer goes that route, also a community-supported NSIS-based alternative does that.

1 Like

After changing my computer, I have only one slow big magnetic drive for daily backups. Why would I move any of my frequently used programs/files/whatever move to this slow drive? :scream:

I think there is a big contradiction in this sentence. If its frequently used folder (it’s not only frequently written, but also frequently read) it’s place is especially on fast drive, so you have quick access to it.

I’m not saying you have to, but if you have some spare time, try to run few programs, preferably with lot of config/work data, once having this config/data on fast SSD, and second time on a 7200 RPM HDD. And tell me you’re not seeing noticeable difference.

On a side note, having fast sdd with config on it makes going through uefi/bios POST routine slower than the actual system boot, and manually starting Firefox with dozen of tabs from last session.

You told they were busting your small SSD by not asking where to install, now you are telling you do not even have an alternative place to put them but your SSD? So even if they were assking you, you were only able to change the place from which they were busting your SSD…

I’ve learnt it were best to not ever write on an SSD after installation because of limited write cycles. And even though I think thats exaggerated a lot, it does tell some truth, since the number of writes is limited.

Personally I am still tied to spinning/magnetic drives, since they are affordable and give me terrabytes of space…

My small SSD system drive. I have small, but very fast NVMe m.2 drive. And there’s huge difference between fast m.2 drive, and slow sata ssd drive (maybe not so much perceivable as between SSD and HDD, but in terms of raw speed it’s much bigger). I simply don’t want to pollute my system drive with immutable read once in run cycle data. The same way you want your /home directory on faster drive than the rest of your Linux installation.

I urge you to read how much data can be written on SSD drives. This is fine example of an endurance test.: The SSD Endurance Experiment: They're all dead - The Tech Report in short out of many 240gb drives tested one that died earliest written 700TB of data. Even if the lifespan of SDD’s was only 100TB, to kill it in a year you’d have to write 27 GB daily, to kill it in thee years you’d have to write ~10 GB daily.

1 Like

Hmm, multiple C++ compiles a day with multi-gig intermediate files on a 512meg SSD for the past 3 years… I wonder how this thing is still alive… >.>

How do you check an SSD health in linux? SMART is not really showing anything wrong.

Same as on Windows I guess. They have internal counter Wear_Leveling_Count and it’s… behold… percentage :joy: 100% meaning we’re good, 0% we starting to really die, but we should be perfectly safe before we actually hit 0%, as 0% does not mean the actual death, but rather only reaching what was guaranteed by manufacturer.

Where do you access that data, I’m not seeing it in the SMART information, here is mine:

╰─➤  _ smartctl -a /dev/sda                                                                                                                                                1 ↵
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-91-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs
Device Model:     Crucial_CT512MX100SSD1
Serial Number:    14290CA47F7D
LU WWN Device Id: 5 00a075 10ca47f7d
Firmware Version: MU01
User Capacity:    512,110,190,592 bytes [512 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Nov 13 16:52:27 2017 MST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x80) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                ( 2380) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (   6) minutes.
Conveyance self-test routine
recommended polling time:        (   3) minutes.
SCT capabilities:              (0x0035) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   000    Pre-fail  Always       -       7
  5 Reallocate_NAND_Blk_Cnt 0x0033   100   100   000    Pre-fail  Always       -       1
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       28307
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       27
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
173 Ave_Block-Erase_Count   0x0032   084   084   000    Old_age   Always       -       492
174 Unexpect_Power_Loss_Ct  0x0032   100   100   000    Old_age   Always       -       19
180 Unused_Reserve_NAND_Blk 0x0033   000   000   000    Pre-fail  Always       -       4402
183 SATA_Interfac_Downshift 0x0032   100   100   000    Old_age   Always       -       0
184 Error_Correction_Count  0x0032   100   100   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   059   048   000    Old_age   Always       -       41 (Min/Max 13/52)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       1
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       0
202 Percent_Lifetime_Used   0x0031   084   084   000    Pre-fail  Offline      -       16
206 Write_Error_Rate        0x000e   100   100   000    Old_age   Always       -       0
210 Success_RAIN_Recov_Cnt  0x0032   100   100   000    Old_age   Always       -       0
246 Total_Host_Sector_Write 0x0032   100   100   000    Old_age   Always       -       84970870538
247 Host_Program_Page_Count 0x0032   100   100   000    Old_age   Always       -       2741168903
248 Bckgnd_Program_Page_Cnt 0x0032   100   100   000    Old_age   Always       -       5226313066

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Vendor (0xff)       Completed without error       00%     16010         -
# 2  Vendor (0xff)       Completed without error       00%      9673         -
# 3  Vendor (0xff)       Completed without error       00%       171         -
# 4  Vendor (0xff)       Completed without error       00%       143         -
# 5  Vendor (0xff)       Completed without error       00%        72         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 1) ==
0x01  0x008  4              27  ---  Lifetime Power-On Resets
0x01  0x010  4           28307  ---  Power-on Hours
0x01  0x018  6     84971001146  ---  Logical Sectors Written
0x01  0x020  6      1063598253  ---  Number of Write Commands
0x01  0x028  6     86903769955  ---  Logical Sectors Read
0x01  0x030  6      1780517369  ---  Number of Read Commands
0x04  =====  =               =  ===  == General Errors Statistics (rev 1) ==
0x04  0x008  4               0  ---  Number of Reported Uncorrectable Errors
0x04  0x010  4              21  ---  Resets Between Cmd Acceptance and Completion
0x05  =====  =               =  ===  == Temperature Statistics (rev 1) ==
0x05  0x008  1              41  ---  Current Temperature
0x05  0x010  1              41  ---  Average Short Term Temperature
0x05  0x018  1              40  ---  Average Long Term Temperature
0x05  0x020  1              52  ---  Highest Temperature
0x05  0x028  1              13  ---  Lowest Temperature
0x05  0x030  1              49  ---  Highest Average Short Term Temperature
0x05  0x038  1              20  ---  Lowest Average Short Term Temperature
0x05  0x040  1              45  ---  Highest Average Long Term Temperature
0x05  0x048  1              26  ---  Lowest Average Long Term Temperature
0x05  0x050  4               -  ---  Time in Over-Temperature
0x05  0x058  1              70  ---  Specified Maximum Operating Temperature
0x05  0x060  4               -  ---  Time in Under-Temperature
0x05  0x068  1               0  ---  Specified Minimum Operating Temperature
0x06  =====  =               =  ===  == Transport Statistics (rev 1) ==
0x06  0x008  4               0  ---  Number of Hardware Resets
0x06  0x010  4               0  ---  Number of ASR Events
0x06  0x018  4               0  ---  Number of Interface CRC Errors
0x07  =====  =               =  ===  == Solid State Device Statistics (rev 1) ==
0x07  0x008  1               3  N--  Percentage Used Endurance Indicator
                                |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value

On a side note, I don’t get the Old_age and Pre-fail bits, it always says those even on brand-new drives…

I’m thinking this drive might actually be more than 3 years old, hmmm… It is at least as old as Aug 14th, 2014, so at least 3.5 years…

lolz, you know what else was an awesome idea, the cornballer.

1 Like

My office desktop
OCZ-ARC100

"ID","Name","Failed","Norm-ed value","Worst","Threshold","Raw value","Type","Flags"
233,"Remaining Lifetime %","never","93","93","0","93","old age","------"

Samsung SSD 840 Series

"ID","Name","Failed","Norm-ed value","Worst","Threshold","Raw value","Type","Flags"
177,"Wear Leveling Count","never","83","83","0","204","<b>pre-failure</b>","PO--C-"

So actually it’s different ID in different drives. In your case I assume it’s

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
202 Percent_Lifetime_Used   0x0031   084   084   000    Pre-fail  Offline      -       16

And this Samsung of mine was was serving me as system drive daily for at least last 5 years. First as my home windows system drive, then as my home system linux drive, now at my workplace as linux system drive. Funny thing, my ~7 years desktop has way more performance than the last year Macbook Air my company has given me :smiley: It’s weight way more though :wink:

1 Like

Heh, if I have 84% of reserved sectors left then I’ve still got a lot of life left, wonder how. ^.^;

What’s so bad about Gtk?

The API is far from being as good and well-documented as Qt and it doesn’t work on macOS without the legacy X11 server.

It looks ancient on other platforms, doesn’t look native anywhere (it does its ‘own’ rendering), missing a lot of features, has concurrency issues that I’ve ran in to repeatedly, in addition to what @wmnnd said among much much more. It is one of those things that I could rant about. ^.^;

2 Likes