-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark-package-install-ci-warm.sh
executable file
·25 lines (21 loc) · 1.36 KB
/
benchmark-package-install-ci-warm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
clear_fs_cache='echo 3 | sudo tee /proc/sys/vm/drop_caches'
warm_yarn_package_cache='find ~/.cache/yarn/ -type f -exec cat "{}" \+ >/dev/null'
warm_bun_package_cache='find ~/.bun/install/cache/ -type f -exec cat "{}" \+ >/dev/null'
(cd website-node-20 && yarn install)
(cd website-bunbuns && bun install)
hyperfine \
--export-json=benchmark-package-install-ci-warm-website.json \
--warmup=2 \
--time-unit=millisecond \
--command-name='Yarn (website)' --prepare="rm -rf website-node-20/node_modules/ && ${clear_fs_cache} && ${warm_yarn_package_cache}" 'cd website-node-20 && yarn install --immutable' \
--command-name='Bun (website)' --prepare="rm -rf website-bunbuns/node_modules/ && ${clear_fs_cache} && ${warm_bun_package_cache}" 'cd website-bunbuns && bun install --frozen-lockfile' \
hyperfine \
--export-json=benchmark-package-install-ci-warm-analytics.json \
--warmup=2 \
--time-unit=millisecond \
--command-name='Yarn (analytics)' --prepare="rm -rf website-node-20/analytics/node_modules/ && ${clear_fs_cache} && ${warm_yarn_package_cache}" 'cd website-node-20/analytics && yarn install --immutable' \
--command-name='Bun (analytics)' --prepare="rm -rf website-bunbuns/analytics/node_modules/ && ${clear_fs_cache} && ${warm_bun_package_cache}" 'cd website-bunbuns/analytics && bun install --frozen-lockfile' \