[MWPW-TBD] Perf: parallelize personalization manifests and start lingo indexes earlier#6208
Closed
mokimo wants to merge 1 commit into
Closed
[MWPW-TBD] Perf: parallelize personalization manifests and start lingo indexes earlier#6208mokimo wants to merge 1 commit into
mokimo wants to merge 1 commit into
Conversation
…dexes earlier - Parallelize getManifestConfig() calls with Promise.all (was serial for-loop) — 300-800ms gain on pages with multiple manifests - Parallelize categorizeActions() calls with Promise.all (synchronous but eliminates microtask overhead) - Add in-flight promise dedup to getEntitlementMap() so concurrent callers share one XLG tags fetch instead of each issuing their own - Move section setup and loadLingoIndexes() before decorateDocumentExtras() so query-index fetches start while header/meta decoration runs (parallel instead of serial) - Deduplicate processQueryIndexMap calls when primary and base locale URLs resolve to the same path (avoids double-fetch on prod with root locale) - Add market.js modulepreload hint before the preview.js dynamic import so both modules load in parallel Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
Commits
|
| if (result) results.push(result); | ||
| } | ||
| results = results.filter(Boolean); | ||
| results = (await Promise.all(experiments.map((exp) => categorizeActions(exp, config)))).filter(Boolean); |
Contributor
| if (localeBase !== undefined) basePfx = localeBase ? `/${localeBase}` : ''; | ||
| baseQueryIndex = processQueryIndexMap(indexUrl(basePfx, ''), host); | ||
| const baseUrl = indexUrl(basePfx, ''); | ||
| baseQueryIndex = primaryUrl === baseUrl ? queryIndexes[siteId] : processQueryIndexMap(baseUrl, host); |
Contributor
Contributor
Author
|
Closed in favor of #6210 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Quick-win performance improvements for the personalization + lingo pipeline.
1.
getManifestConfigserial loop →Promise.all(personalization.js:1429)Each manifest JSON fetch was blocking the next. Now all fetches fire in parallel.
Estimated gain: 300–800 ms on pages with 3+ manifests.
2.
categorizeActionsserial loop →Promise.all(personalization.js:1440)categorizeActionsis effectively synchronous but was wrapped in a serialfor-awaitloop. Now runs viaPromise.all— eliminates microtask waterfall.3.
getEntitlementMapin-flight dedup (personalization.js:1017)When
getManifestConfigcalls run concurrently viaPromise.all, each callsgetPersonalizationVariant→getEntitlementMap. Without dedup, N concurrent callers each issued a separate XLG tags fetch. Fixed by caching the in-flight promise onconfig.mep.entitlementMapFetch.4.
loadLingoIndexesbeforedecorateDocumentExtras(utils.js:2757)Sections (
.sectionclass) are now set up beforedecorateDocumentExtras()is awaited, so query-index fetches start while header/meta decoration runs.Estimated gain: overlaps ~100–300 ms of
decorateDocumentExtraslatency.5. Query index URL dedup (
utils.js:747)loadQueryIndexeswas callingprocessQueryIndexMaptwice with the same URL on prod/live when the locale prefix resolves to the same path for both the primary and base index. Now shares one in-flight fetch object.6.
market.jsmodulepreload beforepreview.jsimport (personalization.js:1722)preview.jshas a staticimportofmarket.js, creating a serial fetch waterfall. Amodulepreloadhint formarket.jsadded right before the dynamicimport('./preview.js')call lets both load in parallel.Resolves: MWPW-TBD
Test URLs (da-cc fr/creativecloud):
milo aem.page:
🤖 Generated with Claude Code