aboutsummaryrefslogtreecommitdiffstats
path: root/.auto/bench.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-08-07 02:22:47 +0200
committerblasty <blasty@local>2026-08-07 02:22:47 +0200
commit8e5a93d319cddb2cc98bb87307c80339c8e4ae26 (patch)
tree406a5b233a4cb5421d3e10d84b87941d71d22737 /.auto/bench.py
parentOnly re-apply a scroll after the next refresh when it actually clamped. Both ... (diff)
downloadida-tui-8e5a93d319cddb2cc98bb87307c80339c8e4ae26.tar.gz
ida-tui-8e5a93d319cddb2cc98bb87307c80339c8e4ae26.tar.xz
ida-tui-8e5a93d319cddb2cc98bb87307c80339c8e4ae26.zip
bench: time a COLD graph open, and stop the fixture picker warming its cache
Diffstat (limited to '.auto/bench.py')
-rw-r--r--.auto/bench.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/.auto/bench.py b/.auto/bench.py
index d869ea3..9ea62d5 100644
--- a/.auto/bench.py
+++ b/.auto/bench.py
@@ -222,6 +222,11 @@ async def phase_graph(app, pilot, funcs):
gv = app.query_one(GraphView)
ok = blocks = 0
spent = 0.0
+ # Space on a function you have not graphed before is the case that hurts:
+ # it pays the flowchart tool, a heads walk over the function's extent, and
+ # the layout. Program caches flowcharts per function, so without this the
+ # phase would time a dict lookup.
+ app.program._flowcharts.clear()
for fn in funcs:
app._open_function(fn.addr, fn.name)
if not await _wait(pilot, lambda fn=fn: app._cur is not None
@@ -400,10 +405,17 @@ async def run_target(binary, reps, nfuncs, pages, frames, terms, skip=0):
if len(big) >= nfuncs:
break
try:
- fc = app.program.flowchart(f.addr)
+ # The raw tool, NOT Program.flowchart: the latter caches, and
+ # picking the fixtures through it left phase_graph measuring
+ # cache hits instead of the work a user waits for.
+ payload = app.program.client.call("flowchart",
+ addr=hex(f.addr))
except Exception: # noqa: BLE001
continue
- if fc is None or len(fc.blocks) > IdaTui.GRAPH_MAX_BLOCKS:
+ if not isinstance(payload, dict) or payload.get("error"):
+ continue
+ nblocks = len(payload.get("blocks") or [])
+ if not nblocks or nblocks > IdaTui.GRAPH_MAX_BLOCKS:
continue
big.append(f)
if len(big) < nfuncs: