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

Improve stress test benchmark #8225

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Improve stress test benchmark #8225

merged 1 commit into from
Aug 25, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Aug 25, 2023

Changes

Improve stress test benchmark to also render other Astro components.

Testing

Ran pnpm astro-benchmark server-stress locally.

Docs

n/a. benchmark changes only.

@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2023

⚠️ No Changeset found

Latest commit: b485183

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines -3 to +6
export const astroBin = createRequire(import.meta.url).resolve('astro');
const astroPkgPath = createRequire(import.meta.url).resolve('astro/package.json');

export const astroBin = path.resolve(astroPkgPath, '../astro.js');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the "astro" entrypoint doesn't point to the CLI anymore, I changed the heuristic to find the CLI file.

Comment on lines +30 to +33
${Array.from({ length: 100 }).map(() => '<p>{content}</p>').join('\n')}
</div>
<div>
${Array.from({ length: 50 }).map((_, i) => '<Paragraph num={' + i + '} str={content} />').join('\n')}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we report these numbers somewhere? Like "Rendered 100 children and 50 astro components."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We currently don't. I'm not sure we need to in case we update this file again, and we might forget updating the description in the other benchmark file.

@bluwy bluwy merged commit 0ae3b7a into main Aug 25, 2023
13 checks passed
@bluwy bluwy deleted the stress-improve branch August 25, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants