Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X installer bloat #292

Closed
quicklizard99 opened this issue Apr 30, 2016 · 4 comments
Closed

Mac OS X installer bloat #292

quicklizard99 opened this issue Apr 30, 2016 · 4 comments
Assignees

Comments

@quicklizard99
Copy link
Member

In order to implement #212 we made use of the scipy and sklearn libraries, which have increased the size of the Mac OS X installer from 122 MB to 262 MB. The Windows installers were not badly affected but we would like to keep things as lean as possible.

Some options

  • Can we include only those bits of scipy and sklearn that we are actually using?
  • Can we reduce the size of the .dmg installer?
@stefanv
Copy link
Contributor

stefanv commented May 1, 2016

One option would be to reduce the dependencies, either by using KDE from scipy (see https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/) or by including the KDE source from scikit-learn. Also, the relative minimum finder used in #212 is pure Python so can easily be copied over (there's no problem with the license, as long as the LICENSE file comes along and is mentioned in the Inselect license).

@quicklizard99
Copy link
Member Author

Thanks @stefanv - very useful. I will have a look at including relevant source and attributing it.

@quicklizard99
Copy link
Member Author

Splitting out relevant bits of scipy and sklearn turns out to be very tricky. It is easy enough for the 'minima detection' bit but harder for kernel density estimation.

@quicklizard99
Copy link
Member Author

Most of the bloat results from PyInstaller's approach of creating a copy of the relevant bits of the virtual env for each frozen binary. We have six binaries - the Inselect application itself and five command-line tools: export_metadata, ingest, read_barcodes, save_crops and segment. So any large binaries could be duplicated up to six times. OpenCV will be present in
five of the six binaries. Contrast this with the approach of cx_Freeze, which creates a single copy of the virtual env that is shared among the six binaries. We use cx_Freeze to create the Windows installers - I was unable to get a working Mac OS X build using cx_Freeze.

Given that most folks won't be interested in the command line tools, I have altered build.sh to create two installers - one containing the Inselect application and one containing the five command-line tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants