Vector35 / Vector35/binaryninja-api

`pyright` type checking is very slow

Open
#8,563 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Description

Version and Platform (required):

  • Binary Ninja Version: 6.0.10601 (can't easily test dev for packaging reasons)
  • Edition: Personal
  • OS: NixOS
  • OS Version: 26.05
  • CPU Architecture: x64

Bug Description:
Importing and using binaryninja.interaction.show_graph_report causes pyright evaluation time to rise from 6s to ~40s.

Steps To Reproduce:

  1. Create test.py
  2. Paste:
from binaryninja.interaction import show_graph_report
show_graph_report(1, 2)
  1. Run pyright --outputjson test.py
  2. Observe timeInSec to be vastly larger than normal (~40s for my system)
  3. Comment out show_graph_report(1, 2)
  4. Rerun pyright and observe timeInSec of below 1s

Expected Behavior:
Importing show_graph_report should not cause a drastic increase in pyright evaluation time.

Screenshots/Video Recording:
If applicable, please add screenshots/video recording here to help explain your problem.

Binary:
If applicable, please provide us with the binary to help us work with the issue faster. Here are a few options:

Additional Information:
I'm using this to get pyright to discover the api in my dev env:

BINJA_ROOT=$(cat "$HOME/.binaryninja/lastrun" | tr -d '\n')
export PYTHONPATH="$BINJA_ROOT/python:$PYTHONPATH"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the test.py example and pyright --outputjson, comparing results with and without show_graph_report(1, 2). Trace the binaryninja.interaction.show_graph_report API and its exposed type information to identify what causes the evaluation slowdown. Done means importing and using it no longer causes the reported drastic increase in pyright time.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.