aboutsummaryrefslogtreecommitdiffstats
path: root/.auto/bench.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-08-07 03:08:47 +0200
committerblasty <blasty@local>2026-08-07 03:08:47 +0200
commitf9496dc9feffbfa4f204c90b962873e20eeff21f (patch)
treea1fc6acac9ab6d37fd4117456f47153ff8684a52 /.auto/bench.py
parentbench: cut two noise sources (pure_graph median-of-3, two reps on the big tar... (diff)
downloadida-tui-f9496dc9feffbfa4f204c90b962873e20eeff21f.tar.gz
ida-tui-f9496dc9feffbfa4f204c90b962873e20eeff21f.tar.xz
ida-tui-f9496dc9feffbfa4f204c90b962873e20eeff21f.zip
bench: run the cold-sensitive phases once, the repeatable ones every rep
Diffstat (limited to '.auto/bench.py')
-rw-r--r--.auto/bench.py34
1 files changed, 24 insertions, 10 deletions
diff --git a/.auto/bench.py b/.auto/bench.py
index 8293ae4..d286c14 100644
--- a/.auto/bench.py
+++ b/.auto/bench.py
@@ -123,7 +123,7 @@ async def phase_nav(app, pilot, funcs):
note("nav_rows", lst.total)
-async def phase_listing(app, pilot, funcs, pages):
+async def phase_listing(app, pilot, funcs, pages, first):
"""Sweep the unified listing, painting each viewport. The first pass pulls
cold pages over the worker; the second is all-cached, i.e. pure python."""
lst = app.query_one(ListingView)
@@ -149,10 +149,15 @@ async def phase_listing(app, pilot, funcs, pages):
cells += _paint(lst)
return cells
- with _T("listing_cold_ms"):
- c = await sweep()
- note("listing_rows", lst.total)
- note("listing_cells", c)
+ if first:
+ # Only on the first repetition: after it the pages are cached and this
+ # would be a second warm sweep wearing the cold sweep's name.
+ with _T("listing_cold_ms"):
+ c = await sweep()
+ note("listing_rows", lst.total)
+ note("listing_cells", c)
+ else:
+ await sweep()
with _T("listing_warm_ms"):
await sweep()
@@ -427,13 +432,22 @@ async def run_target(binary, reps, nfuncs, pages, frames, terms, skip=0):
# that has to walk it. Repeating it would only measure a warm cache.
await phase_nav(app, pilot, big)
- for _ in range(reps):
- await phase_listing(app, pilot, big, pages)
+ # Phases split two ways. The repeatable ones (paint throughput, and
+ # the graph, which clears its own cache) are run every repetition so
+ # the median settles. The cold-sensitive ones -- decompile, search
+ # and the function index all cache their answer, and re-running them
+ # would report a dict lookup under the name of the thing a user
+ # waits for -- are run ONCE.
+ for rep in range(reps):
+ first = rep == 0
+ await phase_listing(app, pilot, big, pages, first)
await phase_render(app, pilot, big, frames)
- await phase_decomp(app, pilot, big)
+ if first:
+ await phase_decomp(app, pilot, big)
await phase_graph(app, pilot, big)
- await phase_search(app, pilot, big, terms)
- await phase_index(app, pilot, big)
+ if first:
+ await phase_search(app, pilot, big, terms)
+ await phase_index(app, pilot, big)
await phase_hex(app, pilot, big, frames // 5)
app.exit()
finally: