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

Tweaks to benchmarking #1401

Merged
merged 15 commits into from
Jun 4, 2024
Merged

Tweaks to benchmarking #1401

merged 15 commits into from
Jun 4, 2024

Conversation

Jakeii
Copy link
Member

@Jakeii Jakeii commented Jun 3, 2024

What does this change?

Builds on the work done by @emma-imber in #1363

Reconfigures phases into seperate projects which can depend on one another.

Use a project to set up the consent state and save the storage state for very rapid testing (we can apply this to our other tests!)

Builds a prod build then runs the tests against prod while overriding commercial files to the locally built versions to get as realistic results as possible.

Run the benchmarks in parallel

Write the results to files so they can be averaged across the workers.

Adds a little PR message with the results (see below).

Why?

Often we don't confidently know how changes will affect ad rendering time, e.g. this PR where we're not sure, and running an AB test just to find out isn't optimal.

It's also revealed that with poorer network connections the difference between ad load times between consented vs consentless is not very pronounced 🤔
That was a mistake the consentless benchmark was still accepting all!

Copy link

changeset-bot bot commented Jun 3, 2024

⚠️ No Changeset found

Latest commit: 06c66c8

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

Copy link
Contributor

github-actions bot commented Jun 3, 2024

Ad load time test results

For consented, top-above-nav took on average 4658.3ms to load.
For consentless, top-above-nav took on average 2982.85ms to load.

Test conditions:

  • 5mbps download speed
  • 1.5mbps upload speed
  • 150ms latency

module.exports = webpackMerge.smart(config, {
mode: 'production',
output: {
filename: `[chunkhash]/graun.standalone.commercial.js`,
chunkFilename: `[chunkhash]/graun.[name].commercial.js`,
filename: `${prefix}graun.standalone.commercial.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.

so that we can optionally build prod without a hash, so playwright can know file names to override the requests to.

@@ -0,0 +1,73 @@
import { defineConfig, devices } from '@playwright/test';
Copy link
Member Author

Choose a reason for hiding this comment

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

New seperate playwright config using playwright projects which can depend on each other.

@Jakeii Jakeii marked this pull request as ready for review June 4, 2024 08:04
@Jakeii Jakeii requested a review from a team as a code owner June 4, 2024 08:04
Copy link
Contributor

@emma-imber emma-imber left a comment

Choose a reason for hiding this comment

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

Very nice!

.github/workflows/test-ad-load-time.yml Outdated Show resolved Hide resolved
body
});
return;
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Fab addition, so much more helpful having this as a comment instead of having to manually check the test outcome

.github/workflows/test-ad-load-time.yml Show resolved Hide resolved
@Jakeii Jakeii merged commit be4b21c into main Jun 4, 2024
11 checks passed
@Jakeii Jakeii deleted the jlk/benchmarck-tweaks branch June 4, 2024 12:34
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.

2 participants