Skip to content

Commit

Permalink
feat: improve performance measuring
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsaplin committed Dec 18, 2023
1 parent 44fccaf commit 101912c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions solutions/scripts/aem-perf-marks.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const config = {
attributeFilter: ['data-section-status', 'data-block-status'],
};

const ids = new Map();
// const ids = new Map();

const observer = new MutationObserver((mutations) => {

Check failure on line 39 in solutions/scripts/aem-perf-marks.js

View workflow job for this annotation

GitHub Actions / linting

Block must not be padded by blank lines

Expand All @@ -45,10 +45,10 @@ const observer = new MutationObserver((mutations) => {
const markName = Array.from(target.classList).join('_');
const status = target.dataset.sectionStatus || target.dataset.blockStatus;
if (status === 'initialized') {
ids.set(target, markName);
// ids.set(target, markName);
target.dataset.perfMark = markName;
window.PerfMarks.create(markName, { section: target.id });
} else if (status === 'loaded') {
} else if (status === 'loaded' && target.dataset.perfMark) {
window.PerfMarks.measure(target.dataset.perfMark);
}
}
Expand Down

0 comments on commit 101912c

Please sign in to comment.