Skip to content

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
louisescher committed Dec 22, 2024
1 parent 7a831e7 commit 1115040
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 23 deletions.
13 changes: 13 additions & 0 deletions benchmarks/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts

COPY . /app

WORKDIR /app

RUN apt-get update && apt-get install -y \
hyperfine \
git

RUN corepack enable

ENTRYPOINT []
50 changes: 27 additions & 23 deletions benchmarks/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ rm -rf */

mkdir .results

ROOT="$PWD"
docker buildx build . -t domainexpansion-bench-image

# git clone --depth 1 https://github.com/withastro/docs &
# git clone --depth 1 https://github.com/zen-browser/www zen-browser &
Expand All @@ -15,6 +15,31 @@ git clone --depth 1 https://github.com/withstudiocms/ui &

wait

docker run -i --rm --name studiocms-ui -v $PWD/ui:/app domainexpansion-bench-image bash <<EOF &
cd /app/docs
mkdir .results
pnpm install
pnpm build
hyperfine \
--export-markdown .results/studiocms-ui.md \
-n '[StudioCMS UI Docs] Normal Build' \
'pnpm build' \
--prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \
-n '[StudioCMS UI Docs] Domain Expansion (cold build)' \
'pnpm build' \
-n '[StudioCMS UI Docs] Domain Expansion (hot build)' \
'pnpm build'
EOF

wait

cp -t .results */.results/*

# rm -rf */

# cd docs

# export NODE_OPTIONS=--max-old-space-size=8192
Expand Down Expand Up @@ -51,21 +76,6 @@ wait

# cd ../ui/docs

cd ui/docs

pnpm install &> /dev/null
pnpm build &> /dev/null # Used as warmup to populate asset cache

hyperfine \
--export-markdown ../../.results/studiocms-ui.md \
-n '[StudioCMS UI Docs] Normal Build' \
'pnpm build' \
--prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \
-n '[StudioCMS UI Docs] Domain Expansion (cold build)' \
'pnpm build' \
-n '[StudioCMS UI Docs] Domain Expansion (hot build)' \
'pnpm build' &

# cd ../../brutal

# pnpm install &> /dev/null
Expand Down Expand Up @@ -109,10 +119,4 @@ hyperfine \
# -n '[Cloudflare Docs] Domain Expansion (cold build)' \
# 'npm run build' \
# -n '[Cloudflare Docs] Domain Expansion (hot build)' \
# 'npm run build' &

wait

cd "$ROOT"

rm -rf */
# 'npm run build' &

0 comments on commit 1115040

Please sign in to comment.