Iāve been evaluating Inkdrop quite a bit, and itās been a very smooth app so far the only thing that doesnāt feel great is the startup time.
For example, my old system of note taking used Sublime Text 3 (a text editor) which takes about 300-600 milliseconds to start, but when I start Inkdrop it takes 4-6 seconds to start up.
I understand that the underlying app is Electron, so thereās limitations there, but I was wondering if there is anything else I can do to keep the startup time as low as possible?
As part of evaluating Inkdrop, Iāve written a few plugins to try to get importing and exporting working the way I want, and it looks like maybe Babel runs for the app or maybe for every plugin on load? Maybe Iām misunderstanding that, it might be cached so only the first startup requires Babel. If not, perhaps that could be an area to explore.
As a software person, the webapps and backend services I use are all JavaScript, and Iāve found some serious startup time savings by bundling the project into a single JS file, or into a small number of JS files. The require file resolution algorithm is very expensive with filesystem access, so bundling many hundreds or thousands of files into a single one can be the difference between a 20 second startup time and a 500 millisecond startup time (in Azure Functions or AWS Lambdas).
Anyway, just wondering if thereās anything I can do, and also offering my optimization knowledge and skills/experience to you if it would be helpful.
The part thatās still particularly relevant is the part on improving the require time. Their solution is snapshots, but I have personally had similarly good results without snapshotting, by creating bundles with e.g. RollupJS. For example, hereās a webapp template Iām using in a few production places, that uses RollupJS to create some bundles: https://github.com/saibotsivad/template-svelte3-asr-business
Thank you for the suggestion.
Yeah, as you and many people say, Electron apps are so sluggish to launch.
Itās annoying for me, too.
Actually, Iāve invested a lot of time on this issue as I wrote an article like this:
Iām using webpack to build the app but it seems like not compatible with electron-link. So, itās hard to generate v8 snapshot with the current build stack at the moment.
In the early versions, Iāve been bundling everything into a single js file with webpack. But it was basically the same startup time as the current version.
I guess thatās because Electron bundles everything into a single asar file.
Inkdropās plugin architecture is based on Atom as I mentioned in this blogpost.
You are right, Inkdrop has babel to transpile ES6 JS files for plugins and it caches them. This file of Atom is the module for transpiled source caching.
So, Iām afraid that Iām not interested in working further on this issue at this point.
If I found a good way to generate v8 snapshot from my webpack source, Iāll be happy to try it.
Thanks again for letting me know your thoughts!
Good news - Iāve finally managed to make use of v8 snapshots for Inkdrop!!!
It shrunk the startup time by 1.5s on my mac.
For example, loading LessCache module became from 175ms to 10ms: