-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
- One problem that people have with Electron apps is that they are big.
- Another problem is that it takes a while until they are finished starting up, reading all the code, compiling and evaluating it takes a while.
Proposed Solution
To the best of my knowledge asar
archives were introduced partially to improve on both of those problems, with much more emphasis on just being able to read files from disk faster, an obvious next step would be to gzip the files in the archive too, but I'm not sure if this has been discussed publicly, I couldn't find anything on that.
For the app I'm working on gzipping the archive brings its size down from ~11MB to ~4MB, which is a significant improvement, especially considering that it's not uncommon to see Electron apps which much larger asar
archives, I wouldn't be surprised if the average was more like 50MB. Cutting this figure by 50~75% would be a significant step toward addressing issue number 1 which IMHO is already a compelling reason for implementing compressed asar archives.
Also regarding issue number 2 the faster files can be read from disk the faster the app can startup, if the asar archive is compressed there's just fundamentally much less stuff to read to begin with, so this should have a positive impact on issue number 2 too. Plus I'm not sure if this matters much, but the browser is kind of designed to work with gzipped files already, piping a gzipped file stream to the streaming parser might improve parse time even more.
Alternatives Considered
Forking Electron? This isn't really something that's reasonable for users to do, Electron should take care of this, ensuring also that many more Electron apps benefit from this kind of optimizations.
Additional Information
N/A.