Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does an Electron.js app respond slow to user inputs?

I ran 'electron-quick-start' app on my PC with Windows 10 via

npm start

It works, but the app responds to clicks and text typing (e.g. in the Console of DevTool, text inputs) too slow. What is the problem? Google Chrome and other browsers work fine on my PC.

like image 614
John Law Avatar asked Nov 02 '16 22:11

John Law


People also ask

Why is electron JS so slow?

If you don’t care about ram usage and bundle size, electron and native apps with same features will have very similar performance. That being said, the electron app you are using is slow most probably because there are ways to slow down Is Electron JS really a good choice to create real-time desktop applications?

Why does my electron app take so much RAM?

Because of that: Size of application built with Electron is typically around ~120 MB. Electron apps usually use a lot of RAM. UI might feel a bit slow, especially on the older computers. Now, even though we can't just delete the whole Chromium from our app and reduce it's size, we can still do something about the RAM usage & speed.

What does electron JS do?

In general, Electron.js deals with the vast majority of the dynamic applications which utilize our program as a stage to convey their inserted highlights and assist us with interfacing a more extensive crowd.

How important is electron for a desktop application?

Wel, my opinion isn’t that important as Electron generates some pretty good desktop applications, when used by skilled people. But Electron is based on Javascript combined with HTML and CSS all packed together with a web browser engine to display content in a single window.


1 Answers

The problem was hardware acceleration. The members of the Electron devteam told me that hardware acceleration may cause input lag.

app.disableHardwareAcceleration(); 

Lag disappeared after writing that command in main.js.

like image 104
John Law Avatar answered Oct 01 '22 14:10

John Law