mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-02 13:27:33 +09:00
Increase thresholds for small function compilation and warm-up to optimize performance for jQuery-style code.
This commit is contained in:
parent
57eac6fab8
commit
2dd5267098
3 changed files with 38 additions and 28 deletions
|
|
@ -47,8 +47,11 @@ OptimizationInfo::initNormalOptimizationInfo()
|
|||
scalarReplacement_ = true;
|
||||
smallFunctionMaxInlineDepth_ = 10;
|
||||
compilerWarmUpThreshold_ = CompilerWarmupThreshold;
|
||||
compilerSmallFunctionWarmUpThreshold_ = CompilerSmallFunctionWarmupThreshold;
|
||||
inliningWarmUpThresholdFactor_ = 0.10;
|
||||
// Start compiling tiny helper functions sooner. This is particularly
|
||||
// useful for jQuery-style code with many frequently-called short helpers.
|
||||
compilerSmallFunctionWarmUpThreshold_ = 32;
|
||||
// Inline callees a bit earlier once a script becomes warm.
|
||||
inliningWarmUpThresholdFactor_ = 0.08;
|
||||
inliningRecompileThresholdFactor_ = 4;
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +115,16 @@ OptimizationInfo::compilerWarmUpThreshold(JSScript* script, jsbytecode* pc) cons
|
|||
warmUpThreshold *= ratio;
|
||||
}
|
||||
|
||||
// jQuery spends a lot of time in medium-small wrappers that are too large
|
||||
// to be classified as "small" but still hot enough to benefit from Ion.
|
||||
// Nudge these scripts toward earlier compilation without affecting large
|
||||
// scripts that are expensive to optimize.
|
||||
if (script->length() <= 400 && numLocalsAndArgs <= 48) {
|
||||
warmUpThreshold = (warmUpThreshold * 3) / 4;
|
||||
if (warmUpThreshold < 30)
|
||||
warmUpThreshold = 30;
|
||||
}
|
||||
|
||||
if (!pc || JitOptions.eagerCompilation)
|
||||
return warmUpThreshold;
|
||||
|
||||
|
|
|
|||
|
|
@ -167,8 +167,9 @@ DefaultJitOptions::DefaultJitOptions()
|
|||
// invalidating the script.
|
||||
SET_DEFAULT(osrPcMismatchesBeforeRecompile, 6000);
|
||||
|
||||
// The bytecode length limit for small function.
|
||||
SET_DEFAULT(smallFunctionMaxBytecodeLength_, 200);
|
||||
// The bytecode length limit for small function. jQuery has many helpers
|
||||
// just above 200 bytecodes, so raise this to compile them sooner.
|
||||
SET_DEFAULT(smallFunctionMaxBytecodeLength_, 320);
|
||||
|
||||
// An artificial testing limit for the maximum supported offset of
|
||||
// pc-relative jump and call instructions.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue