diff --git a/benchmark/.npmrc b/benchmark/.npmrc new file mode 100644 index 000000000..f965bc153 --- /dev/null +++ b/benchmark/.npmrc @@ -0,0 +1 @@ +registry=http://localhost:4873 \ No newline at end of file diff --git a/benchmark/.yarnrc.yml b/benchmark/.yarnrc.yml new file mode 100644 index 000000000..b8c97dcd1 --- /dev/null +++ b/benchmark/.yarnrc.yml @@ -0,0 +1,2 @@ +npmRegistryServer: "http://localhost:4873" +unsafeHttpWhitelist: ["localhost"] \ No newline at end of file diff --git a/benchmark/add.sh b/benchmark/add.sh new file mode 100755 index 000000000..afc194170 --- /dev/null +++ b/benchmark/add.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Make sure to create a .npmrc file +# registry=http://localhost:4873 + +PACQUET="../target/release/pacquet add fastify" +PNPM="pnpm add fastify --silent" +YARN="yarn add fastify --silent" +BUN="bun add fastify --no-cache --no-save --silent" + +FILE_CLEAN="rm -rf package.json pnpm-lock.yaml node_modules .yarn yarn.lock .pnp* && echo {} > package.json" +PNPM_CLEAN="(pnpm cache prune || true)" +YARN_CLEAN="yarn cache clean --all" +CLEANUP="${PNPM_CLEAN} && ${YARN_CLEAN} && ${FILE_CLEAN}" + +$FILE_CLEAN + +hyperfine -w 5 -i \ + --prepare "${CLEANUP}" \ + -n pacquet "${PACQUET}" \ + -n pnpm "${PNPM}" \ + -n yarn "${YARN}" \ + -n bun "${BUN}" + +$FILE_CLEAN diff --git a/benchmark/bunfig.toml b/benchmark/bunfig.toml new file mode 100644 index 000000000..f62a0e16a --- /dev/null +++ b/benchmark/bunfig.toml @@ -0,0 +1,12 @@ +[install] +optional = false +dev = false +# The following does not work +#registry = "http://localhost:4873/" + +[install.cache] +disable = true +disableManifest = true + +[install.lockfile] +save = false \ No newline at end of file