You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The rule runner builds a profile payload for every rule invocation, whether or not profiling is on #274
logger.debug discards everything unless SQUIRREL_RULE_PROFILE=1, but the three filter passes and the nine-key object are ARGUMENTS, so they are evaluated on every call regardless. A page-rule pass over gymshark.com (247 pages) makes 48,906 of those calls; a 2,000-page cloud audit makes roughly 400,000.
The fix is to guard on the exported profileRules flag the logger already reads, so the payload is only built when someone is going to look at it.
Found while measuring template fan-out (squirrelscan/repo#1951): the rule bodies the fan-out removes account for 8.9 s of a 12.5 s improvement on that corpus, and this is one of the candidates for the remainder. It is not measured — file this as an observation, not as a sized win, and measure before and after rather than assuming.
Acceptance Criteria
The per-invocation profile payload and its three filter passes are not evaluated when SQUIRREL_RULE_PROFILE is unset
SQUIRREL_RULE_PROFILE=1 still emits the same [rule-profile] lines, with the same fields, for page and site rules
The change is measured on a real corpus before and after, with the number recorded (including "no measurable difference" if that is the answer)
Activity
perf(audit-engine): run a template-scoped rule once per cluster and f…
perf(audit-engine): run a template-scoped rule once per cluster and f…
perf(rules): build the per-rule profile line only when profiling #274
perf(rules): build the per-rule profile line only when profiling #274 (…