Skip to content

Commit 134e9ad

Browse files
GeneAIclaude
authored andcommitted
docs: Add known false positives to perf-audit workflow
Document patterns that may trigger but aren't actual performance issues: - string_concat_loop: Sequential string building (not in loops) - large_list_copy: Intentional defensive copying - repeated_regex: Single-use in cold paths Examples noted from codebase analysis. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 1b928ae commit 134e9ad

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/empathy_os/workflows/perf_audit.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@
8888
},
8989
}
9090

91+
# Known false positives - patterns that match but aren't performance issues
92+
# These are documented for transparency; the regex-based detection has limitations.
93+
#
94+
# FALSE POSITIVE: string_concat_loop
95+
# - Sequential string building (code += "line1"; code += "line2") is NOT in a loop
96+
# - Examples: examples/coach/wizards/accessibility_wizard.py (lines 330-536)
97+
# - Examples: agents/code_inspection/nodes/reporting.py (HTML building)
98+
# - Verdict: OK - sequential concatenation, not loop-based
99+
#
100+
# FALSE POSITIVE: large_list_copy
101+
# - list(x) or x[:] used for defensive copying or type conversion
102+
# - Often intentional to avoid mutating original data
103+
# - Verdict: OK - usually intentional, low impact
104+
#
105+
# FALSE POSITIVE: repeated_regex (edge cases)
106+
# - Single-use regex in rarely-called functions
107+
# - Verdict: OK - pre-compilation only matters for hot paths
108+
91109

92110
class PerformanceAuditWorkflow(BaseWorkflow):
93111
"""

0 commit comments

Comments
 (0)