We just finished building an electron application with node and react. The application is running smooth on every platform and we are pretty happy of the result. Now we received the request to distribute a version of that app on dvd (meaning that we need to run the application directly from the disc without installing it on the local drive) so we just burn it and tried to launch it. The app is working fine but the problem is the loading time as it takes almost 2 minutes to have the app running without any feedback to the end user. This is caused by the overhead for loading a large number of files which is very slow from the optical drive. So we need some ideas to speed up things or at least to have something to show to the user during the loading time. This could be a launcher application with a splash screen but it must run on mac, win and linux. We thought at QT, but we'd like something less plicated..
Any ideas are wele
We just finished building an electron application with node and react. The application is running smooth on every platform and we are pretty happy of the result. Now we received the request to distribute a version of that app on dvd (meaning that we need to run the application directly from the disc without installing it on the local drive) so we just burn it and tried to launch it. The app is working fine but the problem is the loading time as it takes almost 2 minutes to have the app running without any feedback to the end user. This is caused by the overhead for loading a large number of files which is very slow from the optical drive. So we need some ideas to speed up things or at least to have something to show to the user during the loading time. This could be a launcher application with a splash screen but it must run on mac, win and linux. We thought at QT, but we'd like something less plicated..
Any ideas are wele
Share Improve this question asked Mar 26, 2016 at 17:58 Alessandro Loziobiz BisiAlessandro Loziobiz Bisi 3661 silver badge8 bronze badges 10- Your dvd probably has problems reading the disk. dvd's are fast enough to load an application in a few seconds. Test the disk read performance – dtech Commented Mar 26, 2016 at 18:54
- I tested it on 18 different hardware bination. The optical drive is fast when transferring large files but very slow if you need to read several small files. Even the electron sample app takes more then a minute to load from cd/dvd – Alessandro Loziobiz Bisi Commented Mar 26, 2016 at 21:15
- 1 If you have a high count of very small files, it might be the slow access time that's doing the damage. if possible, you should bine all fines into a single binary file, load into memory and read individual file chunks from there. – dtech Commented Mar 26, 2016 at 23:00
- 4 Electron supports packaging apps into asar archives. I don't know much about it, but it may help with loading times from slow storage. github./atom/electron/blob/master/docs/tutorial/… – Max Commented Mar 27, 2016 at 1:52
- 1 You could wrap your application using one of the numerous unzip systems and run it from an archive depressed into a temporary location. – Kuba hasn't forgotten Monica Commented Mar 28, 2016 at 20:07
3 Answers
Reset to default 2Try packaging your application as an asar
archive. Accessing an archive is faster than accessing multiple small files.
You may want to use electron-builder
for that purpose.
This is most likely not a problem with the application or device you are running it on, it is more likely to be a slow DVD Player or a slow DVD itself, it might also be useful trying to distribute via other methods, such as making an installer and letting people download from a website, or selling USBs with the executable on. Another question, have you converted your electron app from source to executables? It is much faster and easier to start executables than it is to run the electron code from a mand.
I have a theory, it might have to do with the fact that you can't write to your typical DVD, so it may not be the load time, it might be that it's trying to write, and it can't.
I did a little investigation into my theory, and downloaded some electron apps, and then started investigating their package contents (on MacOS) to see if they were modified by the OS during the install process.
Most of the files I encountered had the same creation/modified date from when the app was packaged for deployment. However, in both of these cases, I noticed that inside the Contents/Frameworks there were three directories that were modified at the time I installed the app (Electron Framework.framework, Mantle.framework, ReactiveCocoa.framework, and Squirrel Framework).
It seems that if it tried to make those updates to those files on a DVD, there'd be an error.
That's my theory - it may not be correct, but haven't heard it mentioned here, so maybe look into that.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744389082a4571815.html
评论列表(0条)