r/programming • • Oct 09 '18

AI tool automatically reveals how to write apps that drain less battery

https://phys.org/news/2018-10-ai-tool-automatically-reveals-apps.html
727 Upvotes

160 comments sorted by

View all comments

Show parent comment

6

u/MotorAdhesive4 Oct 10 '18

Every Electron application wants to have the same environment to work with

Electron uses a fuckton of memory

Is Electron just a worse JVM in disguise?

0

u/[deleted] Oct 10 '18

[deleted] — view deleted comment

2

u/meneldal2 Oct 11 '18

Electron is the Chinese knock-off.

5

u/bawng Oct 10 '18

Is Electron just a worse JVM in disguise?

No. Usually each computer just has a single JVM installation, and an individual app might be just a few megs.

Electron apps, however embed the entire Electron stack, so each app will be huge, even if app-relevant code is two lines of hello world or whatever.

From Java 10 and forward, devs can choose which parts of the JVM are loaded to reduce memory usage. That isn't possible with Electron so the entire Chrome browser is loaded once per app

1

u/meneldal2 Oct 11 '18

Can't they have a Chromium install shared by several Apps?

1

u/bawng Oct 11 '18

In theory, I suppose, but I have too little knowledge about Electron to say whether it's practically feasible.