Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CP-51479: Optimize 'make install' (#5982)
We spend quite a lot of time here because dune is invoked multiple times from different makefile rules, also install.sh was very verbose. Draft PR to check github CI. Running `make build install` with no changes to the code is ~3x faster now: ``` Benchmark 1: rm /tmp/install/1 -rf; make -C ../scm-master build install DESTDIR=/tmp/install/1 Time (mean ± σ): 20.575 s ± 0.239 s [User: 13.093 s, System: 9.113 s] Range (min … max): 20.356 s … 21.064 s 10 runs Benchmark 2: rm /tmp/install/2 -rf; make build install DESTDIR=/tmp/install/2 Time (mean ± σ): 6.355 s ± 0.954 s [User: 7.489 s, System: 5.320 s] Range (min … max): 5.827 s … 9.040 s 10 runs Summary rm /tmp/install/2 -rf; make build install DESTDIR=/tmp/install/2 ran 3.24 ± 0.49 times faster than rm /tmp/install/1 -rf; make -C ../scm-master build install DESTDIR=/tmp/install/1 ``` 20s for a noop incremental build was too slow, 6s is still slow, but better. And running just `make install` when there are no changes is about ~7x faster now: ``` Benchmark 1: rm /tmp/install/2 -rf; make install DESTDIR=/tmp/install/2 Time (mean ± σ): 2.791 s ± 0.075 s [User: 4.469 s, System: 4.640 s] Range (min … max): 2.591 s … 2.863 s 10 runs ``` Koji build times are slightly improved too (~3m44s for buildArch phase vs ~4m06s). There are some changes in file permissions, but they look OK (e.g. having execute permissions on the manpages was wrong to begin with): <details> <summary> Permission changes </summary> ``` --- refs 2024-09-16 09:24:17.408911755 +0100 +++ thiss 2024-09-16 09:24:17.415912441 +0100 @@ -1404,7 +1404,7 @@ ./opt/xensource/bin/rrd2csv -rwxr-xr-x ./opt/xensource/bin/static-vdis -rwxr-xr-x ./opt/xensource/bin/update-ca-bundle.sh -rwxr-xr-x -./opt/xensource/bin/xapi -r-xr-xr-x +./opt/xensource/bin/xapi -rwxr-xr-x ./opt/xensource/bin/xapi-autostart-vms -rwxr-xr-x ./opt/xensource/bin/xapi-db-process -rwxr-xr-x ./opt/xensource/bin/xapi-wait-init-complete -rwxr-xr-x @@ -1422,13 +1422,13 @@ ./opt/xensource/bin/xe-switch-network-backend -rwxr-xr-x ./opt/xensource/bin/xe-toolstack-restart -rwxr-xr-x ./opt/xensource/bin/xe-xentrace -rwxr-xr-x -./opt/xensource/bin/xsh -r-xr-xr-x +./opt/xensource/bin/xsh -rwxr-xr-x ./opt/xensource/debug/debug_ha_query_liveset -rwxr-xr-x ./opt/xensource/debug/event_listen -rwxr-xr-x ./opt/xensource/debug/import-update-key -rwxr-xr-x ./opt/xensource/debug/perftest -rwxr-xr-x ./opt/xensource/debug/quicktest -rwxr-xr-x -./opt/xensource/debug/quicktestbin -r-xr-xr-x +./opt/xensource/debug/quicktestbin -rwxr-xr-x ./opt/xensource/debug/rbac_static.csv -rw-r--r-- ./opt/xensource/debug/suspend-image-viewer -rwxr-xr-x ./opt/xensource/debug/vncproxy -rwxr-xr-x @@ -1459,7 +1459,7 @@ ./opt/xensource/libexec/network-init -rwxr-xr-x ./opt/xensource/libexec/pbis-force-domain-leave -rwxr-xr-x ./opt/xensource/libexec/print-custom-templates -rwxr-xr-x -./opt/xensource/libexec/python_nbd_client.py -rw-r--r-- +./opt/xensource/libexec/python_nbd_client.py -rwxr-xr-x ./opt/xensource/libexec/reset-and-reboot -rwxr-xr-x ./opt/xensource/libexec/restore-sr-metadata.py -rwxr-xr-x ./opt/xensource/libexec/save-boot-info -rwxr-xr-x @@ -1705,9 +1705,9 @@ ./usr/sbin/xenopsd-simulator -rwxr-xr-x ./usr/sbin/xenopsd-xc -rwxr-xr-x ./usr/share/man/man1/xcp-networkd.1 -rw-r--r-- -./usr/share/man/man1/xenops-cli.1.gz -rwxr-xr-x -./usr/share/man/man1/xenopsd-simulator.1.gz -rwxr-xr-x -./usr/share/man/man1/xenopsd-xc.1.gz -rwxr-xr-x +./usr/share/man/man1/xenops-cli.1.gz -rw-r--r-- +./usr/share/man/man1/xenopsd-simulator.1.gz -rw-r--r-- +./usr/share/man/man1/xenopsd-xc.1.gz -rw-r--r-- ./usr/share/man/man8/xapi-storage-script.8 -rw-r--r-- ./usr/share/xapi/doc/classes.dot -rw-r--r-- ./usr/share/xapi/doc/doc-convert.sh -rwxr-xr-x @@ -2034,7 +2034,7 @@ ./usr/share/xapi/doc/markdown/class-vtpm.md -rw-r--r-- ./usr/share/xapi/doc/markdown/class-vusb.md -rw-r--r-- ./usr/share/xapi/doc/markdown/classes.md -rw-r--r-- -./usr/share/xapi/doc/markdown/management-api.md -r--r--r-- +./usr/share/xapi/doc/markdown/management-api.md -rw-r--r-- ./usr/share/xapi/doc/markdown/relationships-between-classes.md -rw-r--r-- ./usr/share/xapi/doc/markdown/toc.yml -rw-r--r-- ./usr/share/xapi/doc/markdown/types.md -rw-r--r-- ``` </details>
- Loading branch information