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

MWPW-163603 benchmark card rendering time in PR #3377

Merged
merged 16 commits into from
Jan 13, 2025

Conversation

npeltier
Copy link
Contributor

@npeltier npeltier commented Dec 13, 2024

benchmark page (only CCD for now)
250ms limit in:
/libs/features/mas/docs/benchmarks.html
adjusted to network timing in :
/libs/features/mas/docs/benchmarks.html?adjust=true

There is still a risk that some perf degradation passes tests if they are run on slow networks, but that's all we can do atm.

Test URLs:

Copy link
Contributor

aem-code-sync bot commented Dec 13, 2024

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.46%. Comparing base (5bbb0bf) to head (7a8385a).
Report is 6 commits behind head on stage.

Additional details and impacted files
@@           Coverage Diff           @@
##            stage    #3377   +/-   ##
=======================================
  Coverage   96.46%   96.46%           
=======================================
  Files         255      255           
  Lines       59419    59430   +11     
=======================================
+ Hits        57318    57329   +11     
  Misses       2101     2101           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


test.describe('Benchmark feature test suite', () => {
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
const testPage = `${baseURL}${features[0].path}${miloLibs}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

I do have a concern including this in Milo nala tests.
If freya or wcs cdn will be causing slower render it will fail Milo nala tests and block developers until someone will comment this test out.
We could try it out and if we trues in Freya/WCS stability it would work, however I think we should notify people so that they are aware about this test having external dependencies (it's ok for Nala tests)
And if this test will be flaky we will have to take it out and maybe run it only manually/before release.
We should make sure we don't create stress for Milo community with this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, this is why i added alignement with network capabilities. For the rest items should be cached, so this is CDN response time for constant time we are measuring and this should not change much.
I thought about not adding this systematically and/or raise acceptance bar, but i think this will defeat the purpose of us guaranteeing cards performances

@@ -0,0 +1,40 @@
import '../../../deps/custom-elements.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe its better to place it in src folder
and keep docs folder for html build artifacts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually no, src is for doc build, and docs is for built / as is artifacts, so it's at its place

import '../../spectrum-web-components/dist/action-button.js';
import '../../../features/spectrum-web-components/dist/button.js';
const init = () => {
const ENVS = {
Copy link
Contributor

Choose a reason for hiding this comment

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

kudos on adding this, I would mention it in PR description

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i could yes, i didn't add it to ccd page and i should have, but i'm waiting for @yesil merge on spectrum css before to limit merge work

Copy link
Contributor

@yesil yesil Dec 20, 2024

Choose a reason for hiding this comment

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

Oh, I also have something similar but not common but will replace with this once before merge.

});
masCommerceService.setAttribute('host-env', 'prod');
masCommerceService.setAttribute('lana-tags', 'ccd');
masCommerceService.setAttribute('lana-sample-rate', '100'); // optional, default value is set to '1'
Copy link
Contributor

@3ch023 3ch023 Dec 19, 2024

Choose a reason for hiding this comment

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

including this on every page would pollute our prod logs
ccd page is not throwing errors, but https://mwpw-163603--milo--npeltier.aem.page/libs/features/mas/docs/merch-card.html does

not sure its a big deal, but something worth mentioning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(even if it's 9 views a week)

Copy link
Contributor

@3ch023 3ch023 left a comment

Choose a reason for hiding this comment

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

all looks good, except one small thing:
https://mwpw-163603--milo--npeltier.aem.page/libs/features/mas/docs/benchmarks.html is not referenced from anywhere in documentation which makes it not possible to find

what i keep dreaming about is a sidenav with all our pages, but since its an extra effor it might be too much for this PR. just an idea.
at least please add a link somewhere in mas page.

Copy link
Contributor

This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. If a test absolutely can not pass for a good reason, please add a comment with an explanation to the PR.

<meta charset="UTF-8">
<title>M@S Benchmarks</title>
<script>
const start = performance.now();
Copy link
Contributor

Choose a reason for hiding this comment

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

You can also use mark and measure apis that do not require you to assign values to variables.

performance.mark('commerceStart');
performance.mark('commerceEnd');
performance.measure('commerceLoadTime', 'commerceStart', 'commerceEnd');

</head>

<script>
const measureCardPerformances = async (container, fragmentId) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably incorporate performance api to merch-card and aem-fragment custom elements directly.

and use performance api entries while reporting the measurements.

@npeltier
Copy link
Contributor Author

i'll incorporate @yesil feedbacks + will try to post results to some place

Copy link
Contributor

This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label.

@github-actions github-actions bot added the Stale label Dec 28, 2024
Copy link
Contributor

github-actions bot commented Jan 4, 2025

Closing this PR due to inactivity.

@github-actions github-actions bot closed this Jan 4, 2025
@npeltier npeltier reopened this Jan 4, 2025
@github-actions github-actions bot removed the Stale label Jan 5, 2025
Copy link
Contributor

@3ch023 3ch023 left a comment

Choose a reason for hiding this comment

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

needs a small fix for ccd.html

@@ -51,7 +51,20 @@
</script>
</head>

<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@3ch023 3ch023 left a comment

Choose a reason for hiding this comment

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

could you try running npm install in /libs/features/mas?
i wonder if it will remove changes in merch-stock.js etc

Copy link
Contributor

@yesil yesil left a comment

Choose a reason for hiding this comment

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

LGTM 👍

<body class="spectrum spectrum--medium spectrum--light">
<main>
<body class="spectrum spectrum--medium spectrum--light">
<div class="sidenav">
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure :)

@afmicka afmicka added verified PR has been E2E tested by a reviewer Ready for Stage labels Jan 10, 2025
@milo-pr-merge milo-pr-merge bot merged commit b6e2bcd into adobecom:stage Jan 13, 2025
24 checks passed
@milo-pr-merge milo-pr-merge bot mentioned this pull request Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce Ready for Stage verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants