-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: benchmark | ||
template: post.jinja | ||
author: John Doe | ||
date: 2024-02-23 | ||
categories: | ||
- Technology | ||
- Programming | ||
scripts: | ||
type: post | ||
tags: | ||
- test-post | ||
--- | ||
|
||
# heading L1 | ||
|
||
Lorem ipsum dolor sit amet, officia excepteur ex fugiat reprehenderit enim | ||
labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi | ||
anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est | ||
aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud | ||
officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat | ||
|
||
## heading L2 | ||
|
||
**_bold and italics_** | ||
|
||
> quote text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
set -e | ||
clear | ||
|
||
# parameters | ||
echo "bash: number of md files to create?" | ||
read files | ||
echo "bash: how many warm-up runs?" | ||
read warm | ||
|
||
# echo "bash: cleanup" | ||
cd /tmp || exit | ||
rm -rf bench | ||
mkdir bench; cd bench | ||
|
||
# check if hyperfine is installed | ||
if ! command -v hyperfine &>/dev/null; then | ||
echo "bash!: hyperfine is not installed. Please install hyperfine to continue." | ||
exit 1 | ||
fi | ||
|
||
# cloning candidates | ||
echo "git: cloning ssgs" | ||
git clone --depth=1 https://github.com/acmpesuecc/anna | ||
git clone --depth=1 https://github.com/anirudhRowjee/saaru | ||
|
||
# benchmark file | ||
cp anna/site/content/posts/bench.md test.md | ||
|
||
# build SSGs | ||
cd anna; go build; cd .. | ||
cd saaru; cargo build --release; mv ./target/release/saaru .; cd .. | ||
## pnpx @11ty/eleventy | ||
|
||
# fixes | ||
## saaru fixes (jinja added in the anna bench.md) | ||
## anna fixes (none) | ||
## 11ty fixes (yet to bench) | ||
|
||
# clean content dirs (no md files other than test.md) | ||
rm -rf anna/site/content/posts/* | ||
rm -rf saaru/docs/src/* | ||
|
||
# create multiple copies of the test file | ||
echo "bash: spawning $files different markdown files..." | ||
for ((i = 0; i < files; i++)); do | ||
cp test.md "anna/site/content/posts/test_$i.md" | ||
cp test.md "saaru/docs/src/test_$i.md" | ||
done | ||
|
||
# run the benchmark | ||
echo "hyperfine: running benchmark with hyperfine..." | ||
cd anna; hyperfine -p 'sync' -w $warm "./anna"; cd .. | ||
cd saaru; hyperfine -p 'sync' -w $warm "./saaru --base-path ./docs"; cd .. | ||
|
||
# cleanup | ||
echo "bash: cleaning up" | ||
rm -rf bench |