Skip to content

Commit

Permalink
feat: add initial benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jul 21, 2023
1 parent fbf38e3 commit 3daa484
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions benchmark/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=http://localhost:4873
2 changes: 2 additions & 0 deletions benchmark/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npmRegistryServer: "http://localhost:4873"
unsafeHttpWhitelist: ["localhost"]
25 changes: 25 additions & 0 deletions benchmark/add.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions benchmark/bunfig.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3daa484

Please sign in to comment.