Skip to content

perf(common): drop discarded PeSymbolProvider.parseSymbols in getImportedFunctions#48

Merged
r0ny123 merged 1 commit into
masterfrom
claude/perf-sweep-20260526-binaryinfo-getimports
May 26, 2026
Merged

perf(common): drop discarded PeSymbolProvider.parseSymbols in getImportedFunctions#48
r0ny123 merged 1 commit into
masterfrom
claude/perf-sweep-20260526-binaryinfo-getimports

Conversation

@r0ny123

@r0ny123 r0ny123 commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

Picks up a deferred item from PR #46/47 final reports: BinaryInfo.getImportedFunctions() instantiated PeSymbolProvider(None).parseSymbols(lief_result) and threw away the return value before spinning up a second PeSymbolProvider(None) just to call parseImports. The first call walked lief_binary.symbols and built a function-symbol dict for nothing.

This removes the wasted call. parseSymbols is still invoked from getSymbols() and from PeSymbolProvider.update(), so symbol parsing is unchanged for callers that actually need it.

Behavior compatibility

  • getImportedFunctions() still returns the same dict (it was always the parseImports return value).
  • getSymbols() unchanged.
  • ELF path unchanged.
  • No public API change.

Test plan

  • python -m pytest tests/test* — 111 passed, 79 subtests passed
  • python -m ruff check . — clean
  • python -m ruff format --check . — clean

https://claude.ai/code/session_01C8CcS2k1g59ByLKYdEcaxR


Generated by Claude Code

…rtedFunctions

getImportedFunctions() instantiated PeSymbolProvider(None) and called
parseSymbols(lief_result) only to throw the return value away, then
spun up a second PeSymbolProvider(None) just to call parseImports.
parseSymbols walks lief_binary.symbols and builds a function_symbols
dict; with no `self` mutation (it returns the dict), that work is
purely wasted whenever getImportedFunctions is called.

This removes the dead call. parseSymbols still runs from getSymbols()
and from PeSymbolProvider.update(), so symbol parsing is unchanged
for the callers that actually use it. ELF path is untouched.

Validation:
- pytest tests/test* -> 111 passed, 79 subtests passed
- ruff check + format --check clean

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the getImportedFunctions method in BinaryInfo.py by removing an unnecessary call to PeSymbolProvider(None).parseSymbols(lief_result) when processing PE binaries. No review comments were provided for this change.

@r0ny123 r0ny123 marked this pull request as ready for review May 26, 2026 18:41
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include @coderabbit in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc918551-4f72-4a4b-8d93-9f030e13b0fe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@r0ny123 r0ny123 merged commit fc8d7b9 into master May 26, 2026
45 checks passed
@r0ny123 r0ny123 deleted the claude/perf-sweep-20260526-binaryinfo-getimports branch May 28, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants