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

perf: optimize hot paths and reduce overhead for low-end devices #368

Merged
merged 80 commits into from
Jul 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
4e2f278
perf: compare values ​​directly instead of includes
negezor Jul 12, 2024
a8eddd5
perf: compare first character via access index instead of startsWith
negezor Jul 12, 2024
955b33e
perf: use Set + has instead of an array with includes
negezor Jul 12, 2024
d241e9c
perf(shared): implement split once for fixKeyCase and resolveMetaKeyType
negezor Jul 12, 2024
2552521
feat(shared): introduce thenable helper
negezor Jul 13, 2024
5f7418d
perf(shared): use thenable in normalise for reduce async/await functions
negezor Jul 13, 2024
f845e8d
perf(dom): use promise chain instead of async function in debouncedRe…
negezor Jul 13, 2024
0b84990
chore(dom): remove async modifier for debouncedRenderDOMHead
negezor Jul 13, 2024
db93926
perf(shared): remove unnecessary array spread in tagDedupeKey
negezor Jul 13, 2024
933380a
refactor: undefined is allowed for spread object
negezor Jul 13, 2024
159ea79
perf(schema-org): avoid new array allocation in dedupeMerge
negezor Jul 13, 2024
e11e9c2
perf(dom): check empty class or style in foreach instead of allocatio…
negezor Jul 13, 2024
54b9efa
perf(dom): implement split once for style in trackCtx
negezor Jul 13, 2024
d753005
perf(dom): convert tag name to lowercase once in renderDOMHead
negezor Jul 13, 2024
0ee43de
refactor: compare with undefined without typeof in safe places
negezor Jul 13, 2024
598d8e6
test(shared): add benchmark for processTemplateParams
negezor Jul 14, 2024
a8a3f5a
perf(shared): move sub to top module in templateParams
negezor Jul 14, 2024
2846564
perf(shared): avoid unnecessary operations in processTemplateParams
negezor Jul 14, 2024
a683e20
perf(shared): use single replacer in processTemplateParams
negezor Jul 14, 2024
1c03cce
refactor(dom): move condition to else in renderDOMHead
negezor Jul 14, 2024
3b89662
Merge branch 'main' into perf
negezor Jul 14, 2024
f3aad3c
Merge branch 'unjs:main' into perf
negezor Jul 16, 2024
476a410
perf(shared): combine filter in normaliseStyleClassProps
negezor Jul 16, 2024
5158bb1
perf(shared): optimize normaliseEntryTags for handle tag promises
negezor Jul 16, 2024
598719d
refactor: use arrow function instead of regular anonymous
negezor Jul 16, 2024
1761dfb
perf(shared): cache allowed meta properties for tagDedupeKey
negezor Jul 16, 2024
067f9bd
perf(shared): use concurrency chain instead of Promise.all in normali…
negezor Jul 16, 2024
fde9f9c
perf(unhead): allocate once third party dedupe keys in dedupe plugin
negezor Jul 16, 2024
d345bf7
refactor(shared): remove second parameter in tagDedupeKey
negezor Jul 16, 2024
028585b
fix(shared): normalise should handle consistently
negezor Jul 17, 2024
b1caa72
perf(shared): reduce overhead from object.entries and map in normalis…
negezor Jul 17, 2024
fc32e5e
perf(shared): promise should be edge case in normaliseProps
negezor Jul 17, 2024
20ce4ae
chore(shared): remove export from nestedNormaliseProps
negezor Jul 17, 2024
0da77eb
perf(shared): promise should be edge case in normaliseEntryTags
negezor Jul 17, 2024
1088358
fix(shared): switch condition in for i in nestedNormaliseEntryTags
negezor Jul 17, 2024
78e4f0e
chore(shared): rename resolvedTags to tagPromises in nestedNormaliseE…
negezor Jul 17, 2024
afbbf93
perf(shared): reduce overhead by using thenable in normaliseProps
negezor Jul 17, 2024
5aa2c97
perf(shared): promise should be edge case in normaliseTag
negezor Jul 17, 2024
38efeb9
perf(shared): use for of instead of forEach in normaliseTag
negezor Jul 17, 2024
ee3d190
perf(unhead): move common props to top of module in dedupe plugin
negezor Jul 17, 2024
09a9d68
perf(unhead): use for in instead of object values in dedupe plugin
negezor Jul 17, 2024
5478958
perf(unhead): use for of instead of forEach in dedupe plugin
negezor Jul 17, 2024
0ea560f
perf(unhead): use for in instead of object entries in eventHandler pl…
negezor Jul 17, 2024
4a66828
perf(unhead): use slice & substring instead of replace in eventHandler
negezor Jul 17, 2024
3b3481b
perf(unhead): move filter into loop body in sort plugin
negezor Jul 17, 2024
1e64fd8
perf(unhead): use substring instead of replace in sort plugin
negezor Jul 17, 2024
a53e10f
perf(unhead): swap the loops in the sorting plugin
negezor Jul 17, 2024
95a5521
perf(shared): simplify complexity in tagWeight
negezor Jul 17, 2024
f90c77a
perf(unhead): combine sorts in sort plugin
negezor Jul 17, 2024
cb26835
perf(unhead): reduce complexity to search in templateParams plugin
negezor Jul 17, 2024
ce653f8
perf(unhead): move filter into loop body in templateParams plugin
negezor Jul 17, 2024
e6b5d1a
perf(unhead): find and remove once templateParams tag in templatePara…
negezor Jul 17, 2024
f120960
perf(unhead): improve contentAttrs handle in templateParams plugin
negezor Jul 17, 2024
cbae67e
perf(unhead): speed up payload plugin using one loop
negezor Jul 17, 2024
18bf288
perf(unhead): compute props keys after static in dedupe plugin
negezor Jul 17, 2024
b750c32
perf(unhead): use splice instead of delete index + filter in titleTem…
negezor Jul 17, 2024
667e15e
perf(unhead): first check hasProps in dedupe plugin
negezor Jul 17, 2024
e74bbc5
perf(unhead): handle classes & styles without loop in dedupe plugin
negezor Jul 17, 2024
0476089
perf(unhead): use object with null prototype in dedupe plugin
negezor Jul 17, 2024
d1ccd89
perf(unhead): use for of loop instead of map for patch entry
negezor Jul 17, 2024
e29952f
perf(dom): use for in loop for props instead of Object.entries in ren…
negezor Jul 17, 2024
9214fe7
perf(dom): use for in loop for handle _eventHandlers in renderDOMHead
negezor Jul 17, 2024
32851ff
perf(dom): clear side effects in for in loop in renderDOMHead
negezor Jul 17, 2024
4193b98
perf(dom): replace loop with a direct property check for textContent …
negezor Jul 17, 2024
f391c98
perf(dom): remove cast to array HTMLCollection in renderDOMHead
negezor Jul 17, 2024
fd0c261
perf(unhead): speed up hashTag using for in loop & early returns
negezor Jul 17, 2024
ec0f70f
perf(vue): reduce overhead from resolveUnrefHeadInput
negezor Jul 17, 2024
4dbbd59
perf(dom): use set to store taken dedupe keys
negezor Jul 17, 2024
c2aa41b
perf(ssr): use string concatenation in propsToString
negezor Jul 17, 2024
3c99210
perf(ssr): add space before attrs in propsToString
negezor Jul 18, 2024
9e4e271
perf(ssr): use string concatenation in ssrRenderTags
negezor Jul 18, 2024
0967e7a
perf(ssr): use object.assign instead of spread operator
negezor Jul 18, 2024
c476861
perf(shared): use for of instead of array map
negezor Jul 18, 2024
1548f16
perf(shared): check the static string first in fixKeyCase
negezor Jul 18, 2024
168c79a
perf(shared): use for in & for of loops in meta
negezor Jul 18, 2024
bd3038f
perf(schema-org): use for in loop in resolveNodeId
negezor Jul 18, 2024
c6e7c35
perf(schema-org): use for in loop in stripEmptyProperties
negezor Jul 18, 2024
36b1dc9
perf(unhead): delete tag._duped if exists in dedupe plugin
negezor Jul 18, 2024
a6da0f9
perf(unhead): remove loop for check third party dedupe keys in dedupe…
negezor Jul 18, 2024
4f530d8
perf(shared): reduce operations in eventHandler plugin
negezor Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into perf
  • Loading branch information
negezor authored Jul 14, 2024
commit 3b8966241beb4c0accbd2a6d4acf2d8e0b378f64
3 changes: 2 additions & 1 deletion packages/addons/src/plugins/inferSeoMetaPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export interface InferSeoMetaPluginOptions {
for (const entry of entries) {
const inputKey = entry.resolvedInput ? 'resolvedInput' : 'input'
const input = entry[inputKey]
if (input.titleTemplate !== undefined)
const weight = (typeof input.titleTemplate === 'object' ? input.titleTemplate?.tagPriority : false) || entry.tagPriority || 100
if (input.titleTemplate !== undefined && weight <= lastWeight) {
titleTemplate = input.titleTemplate
lastWeight = weight
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.