mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
fix(linter/plugins): include executing selectors in JS plugin rule timings (#27111)
Follow-on after #26415. That PR added timings for JS plugins. Add one tweak - include matching selectors within the timings. If rules use complex selectors, this time can be significant, and should be included in the measured cost of the rule.
This commit is contained in:
1 parent
a5290a690b
commit
611e4ed894
1 file changed
+2
-4
@@ -349,10 +349,8 @@ export function addVisitorToCompiled(visitor: VisitorObject, timing?: RuleTiming
|
||||
visitProp.specificity |= selector.specificity;
|
||||
|
||||
if (selector.isComplex) {
|
||||
const timedVisitFn = visitProp.fn;
|
||||
debugAssertIsNonNull(timedVisitFn);
|
||||
typeAssertIs<VisitFn>(timedVisitFn);
|
||||
visitProp.fn = wrapVisitFnWithSelectorMatch(timedVisitFn, selector.esquerySelector);
|
||||
visitProp.fn = wrapVisitFnWithSelectorMatch(visitFn, selector.esquerySelector);
|
||||
if (timing !== undefined) visitProp.fn = wrapTimedFunction(visitProp.fn, timing);
|
||||
}
|
||||
|
||||
const { typeIds } = selector;
|
||||
|
||||
Reference in new issue
Block a user