Skip to content

Commit

Permalink
feat: add benchmark results for StudioCMS UI, Zen Browser, and Brutal…
Browse files Browse the repository at this point in the history
… Theme; update README and benchmark script for improved output
  • Loading branch information
louisescher committed Dec 23, 2024
1 parent 02c0fe2 commit a972bce
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 25 deletions.
3 changes: 3 additions & 0 deletions benchmarks/.results/brutal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|:---|---:|---:|---:|---:|
| `[Brutal Theme] Normal Build` | 4.096 ± 0.240 | 3.758 | 4.378 | 1.00 |
5 changes: 0 additions & 5 deletions benchmarks/.results/starlight.md
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|:---|---:|---:|---:|---:|
| `[Starlight Docs] Normal Build` | 34.563 | 34.563 | 34.563 | 1.33 |
| `[Starlight Docs] Domain Expansion (cold build)` | 30.797 | 30.797 | 30.797 | 1.18 |
| `[Starlight Docs] Domain Expansion (hot build)` | 26.035 | 26.035 | 26.035 | 1.00 |
5 changes: 5 additions & 0 deletions benchmarks/.results/studiocms-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|:---|---:|---:|---:|---:|
| `[StudioCMS UI Docs] Normal Build` | 11.557 ± 0.823 | 10.297 | 12.365 | 1.00 |
| `[StudioCMS UI Docs] Domain Expansion (cold build)` | 11.826 ± 0.831 | 10.843 | 12.949 | 1.02 ± 0.10 |
| `[StudioCMS UI Docs] Domain Expansion (hot build)` | 12.122 ± 1.282 | 9.705 | 13.684 | 1.05 ± 0.13 |
5 changes: 5 additions & 0 deletions benchmarks/.results/zen-browser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|:---|---:|---:|---:|---:|
| `[Zen Browser Website] Normal Build` | 15.111 ± 0.715 | 14.233 | 15.955 | 1.00 |
| `[Zen Browser Website] Domain Expansion (cold build)` | 19.016 ± 1.673 | 17.277 | 21.466 | 1.26 ± 0.13 |
| `[Zen Browser Website] Domain Expansion (hot build)` | 19.186 ± 1.038 | 17.838 | 20.768 | 1.27 ± 0.09 |
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RAM: 32GB DDR4 3200MHz

## Getting Started

First, install [`hyperfine`](https://github.com/sharkdp/hyperfine?tab=readme-ov-file). You can find instructions in their README file. To run this benchmark, you also need to have `git` installed.
First, install [`hyperfine`](https://github.com/sharkdp/hyperfine?tab=readme-ov-file). You can find instructions in their README file. To run this benchmark, you also need to have `git` and Python `3.11` or earlier installed.

Once installed, run the `bench.sh` script in this directory.

Expand Down
57 changes: 38 additions & 19 deletions benchmarks/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ EXCLUED_BENCHMARKS=""

while [[ $# -gt 0 ]]; do
case $1 in
--excluded=*)
--exclude=*)
excluded_list="${1#*=}" # Extract the value after '='
shift
;;
Expand Down Expand Up @@ -114,10 +114,13 @@ if ! is_excluded "zen-browser"; then

echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}zen-browser/www${NO_FORMAT}${F_BOLD}...${NO_FORMAT}"

pnpm install &> /dev/null
pnpm build &> /dev/null
echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..."
yes | pnpm install &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}"

echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"
echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT}..."
pnpm build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"

hyperfine \
--export-markdown "$ROOT/.results/zen-browser.md" \
Expand All @@ -141,15 +144,17 @@ if ! is_excluded "studiocms-ui"; then

echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}withstudiocms/ui${NO_FORMAT}${F_BOLD}...${NO_FORMAT}"

pnpm install &> /dev/null
pnpm build &> /dev/null
echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..."
yes | pnpm install &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}"

echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"
echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT}..."
pnpm build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"

hyperfine \
--export-markdown "$ROOT/.results/studiocms-ui.md" \
--prepare '' \
--runs 1 \
-n '[StudioCMS UI Docs] Normal Build' \
'pnpm astro build' \
--prepare 'pnpm astro add @domain-expansion/astro -y && rm -rf ./node_modules/.domain-expansion' \
Expand All @@ -169,12 +174,16 @@ if ! is_excluded "brutal"; then

echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}eliancodes/brutal${NO_FORMAT}${F_BOLD}...${NO_FORMAT}"

pnpm install &> /dev/null
pnpm build &> /dev/null
echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..."
yes | pnpm install &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}"

echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"
echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT}..."
pnpm build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"

hyperfine \
--show-output \
--export-markdown "$ROOT/.results/brutal.md" \
-n '[Brutal Theme] Normal Build' \
--prepare '' \
Expand All @@ -196,12 +205,16 @@ if ! is_excluded "starlight"; then

echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}withastro/starlight${NO_FORMAT}${F_BOLD}...${NO_FORMAT}"

pnpm install &> /dev/null
pnpm build &> /dev/null
echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..."
yes | pnpm install &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}"

echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"
echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT}..."
pnpm build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"

hyperfine \
--show-output \
--export-markdown "$ROOT/.results/starlight.md" \
--prepare '' \
-n '[Starlight Docs] Normal Build' \
Expand All @@ -223,10 +236,13 @@ if ! is_excluded "cloudflare-docs"; then

echo -e "\n${F_BOLD}Running Setup for ${C_STEELBLUE1}cloudflare/cloudflare-docs${NO_FORMAT}${F_BOLD}...${NO_FORMAT}"

echo -e " Running ${C_STEELBLUE1}npm install${NO_FORMAT}..."
npm install &> /dev/null
npm run build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}"

echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"
echo -e " Running ${C_STEELBLUE1}npm run build${NO_FORMAT}..."
npm run build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"

hyperfine \
--export-markdown "$ROOT/.results/cloudflare-docs.md" \
Expand All @@ -253,10 +269,13 @@ if ! is_excluded "astro-docs"; then

export NODE_OPTIONS=--max-old-space-size=12192 SKIP_OG=true;

pnpm install &> /dev/null
pnpm build &> /dev/null
echo -e " Running ${C_STEELBLUE1}pnpm install${NO_FORMAT}..."
yes | pnpm install &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}"

echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"
echo -e " Running ${C_STEELBLUE1}pnpm build${NO_FORMAT}..."
pnpm build &> /dev/null
echo -e " ${C_MEDIUMSPRINGGREEN}Done!${NO_FORMAT}\n"

hyperfine \
--export-markdown "$ROOT/.results/astro-docs.md" \
Expand Down

0 comments on commit a972bce

Please sign in to comment.