Vimjas/vim-testbed

Optimize image size: remove doc/tutor/etc?

blueyed opened this issue · 7 comments

Looking at /vim-build/vim_*/share there are a lot of things that could be possibly pruned:

  • 696.0 KiB [ ] /man

From share/vim/vim80:

  • 6.6 MiB [##########] /doc
  • 3.5 MiB [##### ] /spell
  • 2.3 MiB [### ] /tutor
  • 1.0 MiB [# ] /lang
  • 348.0 KiB [ ] /keymap

Currently vim_v8.0.0027_py0_rb0_lua0 takes 27.9 MiB, which is not that much by itself, but 6 builds will be 160.0 MiB (Apparent size: 137.0 MiB) then.

What about an option to the install_vim script to prune those (we can agree on)?

Hmm, yeah. A flag like --no-prune in case those files are needed for testing.

The potential size is higher if you consider multiple builds of the same Vim version. Like having multiple builds for Python 2 and Python 3 would mean that there's 2n builds, or 3n if you want to include a build without Python.

Maybe a further optimization would be for the same Vim version to share the shared directory. Instead of vim_v8.0.0027_py0_rb0_lua0 it would be vim_v8.0.0027/py0_rb0_lua0/... with the shared data at vim_v8.0.0027/shared

Maybe a further optimization would be for the same Vim version to share the shared directory.

Good idea.

What's your opinion on which to remove?
Are the ones I've listed OK?

Oh sorry, yes. Those look fine to me.

I had some thoughts after scanning through them:

  • I wonder why there isn't a build option to only include localizations that matches $LANG.
  • I'm not a multilingual user--I don't know the importance of lang or keymap in regard to automated tests.
    • Their sizes are relatively small and it would be dumb to include the much larger doc and tutor if --no-prune is used when only the localizations are required.
  • I could imagine a plugin needing spell if a plugin interacts with that feature.
  • It seems that much of the bulk in spell, lang, and tutor is localization files. Deleting the localizations and leaving the default en localizations would give a "complete" installation without completely neutering the shared directories.
  • tutor is only useful if you're testing the tutor feature.

I think pruning those directories is 100% fine since I personally can't see a use for them. So, I don't think these need to be considered to address this issue. I'm mainly writing it out in case they give you an epiphany or someone in the future is searching the issues to figure out why they got pruned 🤓

maybe use alpine's default shell? bash 4.4 is 9mb on my mac, vs 200k for dash

https://github.com/tweekmonster/vim-testbed/blob/master/scripts/run_vim.sh#L6 the == is the only bash specific thing according to shell check

IIRC I am using / rely on bashisms in Neomake's tests.

#26 removes bash.