-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(benchmarks): add circleci job (#20490)
Co-authored-by: Dustin Schau <dustinschau@gmail.com> Co-authored-by: Dustin Schau <DSchau@users.noreply.github.com>
- Loading branch information
1 parent
b4d5795
commit 08c78c8
Showing
5 changed files
with
80 additions
and
2 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
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,24 @@ | ||
# Benchmarks | ||
|
||
Example sites for benchmarking `gatsby`. | ||
|
||
## Interface | ||
|
||
The standard interface for running a benchmark is: | ||
|
||
``` | ||
cd {benchmark directory} | ||
export NUM_PAGES={n} | ||
npm install | ||
gatsby build | ||
``` | ||
|
||
If a specific benchmark needs to perform some code generation (e.g. `markdown_id`), | ||
that generation shall happen in a `postinstall` script. | ||
Any `postinstall` script must ensure that previous benchmark runs do not interfere with the current run. | ||
|
||
For example: | ||
|
||
``` | ||
"postinstall": "del-cli ./generated && gatsby clean && npm run generate" | ||
``` |
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
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
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,33 @@ | ||
#!/bin/bash -eux | ||
|
||
set -e | ||
set -u | ||
set -x | ||
|
||
BENCHMARKS=( | ||
# create-pages | ||
# image-processing | ||
markdown_id | ||
markdown_slug | ||
markdown_table | ||
# plugin-manifest | ||
# query | ||
) | ||
|
||
SIZES=( | ||
1000 | ||
5000 | ||
10000 | ||
25000 | ||
# 100000 | ||
) | ||
|
||
cd benchmarks | ||
for benchmark in "${BENCHMARKS[@]}"; do | ||
cd "${benchmark}" | ||
for num in "${SIZES[@]}"; do | ||
NUM_PAGES=${num} npm install | ||
NUM_PAGES=${num} ./node_modules/.bin/gatsby build | ||
done | ||
cd .. | ||
done |