问题
We are building a restaurant POS system with Electron (nodeJS 7.4.0/Electron 1.6.11). For a POS system, speed and reliability are the 2 most important requirements, and after having spent some time building the app we are no longer certain if Electron is the right software for us.
Speed seems to be the main issue. For testing, we've built an app that only shows 2 "hello world" html pages without any additional javascript or any other assets. When running on a modern iMac, there's a short delay when switching between the pages and the app flashes white between the page loads. On an older PC running Windows 7, it takes up to 1 second to simply switch between these 2 pages. Load time on the mac is 167ms for an empty "Hello World" page.
Now, running these 2 pages directly in the Chrome browser, the pages load instantly, without any loading time and no white flash between page loads. 40ms in the network inspector.
The difference in speed is a lot more significant with more complex pages loading Javascript files and images (even though everything is loaded locally)
What's the reason for the much longer loading time in Electron vs Chrome, what could we be doing wrong ?
来源:https://stackoverflow.com/questions/45156262/nodejs-electron-renders-pages-slower-than-chrome