Skip to content

Minimising Installation Size

Ben Jackson edited this page May 1, 2021 · 6 revisions

TL;DR

  • Use a recursive shallow clone
  • Only enable the completers you really need, or use g:ycm_*_binary_path options to use existing installations
  • Upgrade by deleting the installation and doing a new shallow clone

YCM installation size is sometimes a concern for users.

The following command is the best way to minimise the installation size:

git clone --shallow-submodules --remote-submodules --depth 1 --recursive https://github.com/ycm-core/YouCompleteMe

Then follow the standard installation (python3 install.py for example). At time of writing (Oct 2020), this leads to about 120MB installation after building. With all completers enabled, it's around 1.3GB. Of course, the fewer completers you enable, the smaller the size.

You can use external, system installed, engines to avoid YCM installing new copies. See the options like --clangd-binary-path, and other similar options in the README.

Note that the installation size does grow over time, effectively with each update, however, you can keep the installation small by simply wiping out the entire installation (rm -rf YouCompleteMe) and re-cloning and re-building.

Note that the developers are aware that this is a concern for some users, and we are actively trying to reduce over time.

If space is absolutely premium, and you already have the relevant completer server installed, use the g:ycm_*_binary_path options to tell YCM to use external installations of the completion engines.


ben@BenMBP minimal % git clone --shallow-submodules --depth 1 --recursive https://github.com/ycm-core/YouCompleteMe
... snip
ben@BenMBP minimal % du -sh YouCompleteMe
109M	YouCompleteMe
ben@BenMBP minimal % cd YouCompleteMe
ben@BenMBP YouCompleteMe % ./install.py --all --quiet
Generating ycmd build configuration...OK
Compiling ycmd target: ycm_core...OK
Generating regex build configuration...OK
Compiling regex module...OK
Building watchdog module...OK
Installing Omnisharp for C# support...OK
Building gopls for go completion...OK
Setting up Tern for JavaScript completion...OK
Installing rust-analyzer for Rust support...OK
Installing jdt.ls for Java support...OK
Installing TSServer for JavaScript and TypeScript completion...OK
Setting up Clangd completer...OK
ben@BenMBP YouCompleteMe % du -sh .
1.3G	.
ben@BenMBP YouCompleteMe %

To give an impression of where the space is taken up, it's by the completion engines enabled:

ben@BenMBP third_party % du -sk * | sort -n
124	generic_server
832	waitress
1108	bottle
1196	watchdog_deps
3740	tern_runtime
5460	cregex
12404	jedi_deps
14420	requests_deps
44024	go
44028	clangd
53256	tsserver
89116	clang
108128	eclipse.jdt.ls
176168	omnisharp-roslyn
738876	rust-analyzer
ben@BenMBP third_party %