Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(gatsby): Move memory benchmark to generic benchmark, add support for develop and custom site #35703

Merged
merged 6 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix develop build
  • Loading branch information
imjoshin committed May 19, 2022
commit 82f89daaf83eb534679a17a9d1b21536ea08042b
2 changes: 1 addition & 1 deletion benchmarks/generic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN npm i -g gatsby-cli gatsby-dev-cli
# set heap to 16gb just to catch all test cases
ENV NODE_OPTIONS="--max-old-space-size=16368"

RUN echo "\n\necho \"Welcome to the Gatsby Memory benchmark container!\\n - /usr/src/gatsby : Your local gatsby repo\\n - /usr/src/app : The memory benchmark gatsby site\\n\"" > /root/.bashrc
RUN echo "\n\necho \"Welcome to the Gatsby benchmark container!\\n - /usr/src/gatsby : Your local gatsby repo\\n - /usr/src/app : The benchmark gatsby site\\n\"" > /root/.bashrc

RUN if [ "$jemalloc" = "1" ]; then \
echo "Using jemalloc for memory allocation" && \
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/generic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It has ports 9000 (for hosting gatsby) and 9229 (for debugging) exposed.
Within the container, two points to your local filesystem are mounted:

- /usr/src/gatsby : Your local gatsby repo
- /usr/src/site : The benchmark gatsby site
- /usr/src/app : The benchmark gatsby site

If you'd like to configure `jemalloc` to run within the container, set the `JEMALLOC=1` env var when building the docker container.

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/generic/scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function build(dockerExec) {

start = Date.now()
const { err } = await dockerExec(
`yarn gatsby build`,
`yarn gatsby:build`,
{
BUILD_NUM_NODES: args.numNodes,
BUILD_STRING_NODE_SIZE: args.nodeSize,
Expand Down Expand Up @@ -94,11 +94,11 @@ async function develop(dockerExec) {
console.log(` - clearing cache`)
await dockerExec(`rm -rf .cache`)

console.log(` - running build with ${args.numNodes} nodes of size ${args.nodeSize}`)
console.log(` - running develop with ${args.numNodes} nodes of size ${args.nodeSize}`)

start = Date.now()
const process = dockerExec(
`yarn gatsby develop --port 9000`,
`yarn gatsby:develop`,
{
BUILD_NUM_NODES: args.numNodes,
BUILD_STRING_NODE_SIZE: args.nodeSize,
Expand Down