diff --git a/benchmarks/Dockerfile b/benchmarks/Dockerfile new file mode 100644 index 0000000..c7eca4a --- /dev/null +++ b/benchmarks/Dockerfile @@ -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 [] \ No newline at end of file diff --git a/benchmarks/bench.sh b/benchmarks/bench.sh index 85a1e08..e0dae63 100755 --- a/benchmarks/bench.sh +++ b/benchmarks/bench.sh @@ -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 & @@ -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 < /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 @@ -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 */ \ No newline at end of file +# 'npm run build' & \ No newline at end of file