Skip to content

Commit ce5b0f5

Browse files
committed
perf(intel): use set.difference_update in FunctionCandidate.removeCallRefs
Follow-up to the call_ref_sources list-to-set switch: collapse the Python-level "for addr in source_addrs: discard()" loop into a single set.difference_update() call. The semantics are identical (both no-op on missing elements) but the work is now done in optimized C, which matters because removeCallRefs is called from FunctionCandidateManager.updateCandidates whenever HIGH_ACCURACY is on (the default) and conflicts are detected during CFG recovery. Validation: - pytest tests/test* -> 90 passed, 43 subtests passed - ruff check + format --check clean
1 parent c3bd97f commit ce5b0f5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/smda/intel/FunctionCandidate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def addCallRef(self, source_addr):
8686
self._score = None
8787

8888
def removeCallRefs(self, source_addrs):
89-
for addr in source_addrs:
90-
self.call_ref_sources.discard(addr)
89+
self.call_ref_sources.difference_update(source_addrs)
9190
self._score = None
9291

9392
def setIsTailcallCandidate(self, is_tailcall):

0 commit comments

Comments
 (0)