diff options
| author | blasty <blasty@local> | 2026-08-09 23:35:32 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-08-09 23:35:32 +0200 |
| commit | 933efafa9fa3e74d435ae580bedbd8ff54597bef (patch) | |
| tree | d563dc3b47c744784d41d631363533272268497f /docs/CODEMODE_UPSTREAM.md | |
| parent | experiments: count backend round-trips per user action (diff) | |
| download | ida-tui-933efafa9fa3e74d435ae580bedbd8ff54597bef.tar.gz ida-tui-933efafa9fa3e74d435ae580bedbd8ff54597bef.tar.xz ida-tui-933efafa9fa3e74d435ae580bedbd8ff54597bef.zip | |
remote_tools: hoist the IDAPython imports to module scope (~3%)
_idatui_head_row ran 'import ida_bytes/ida_lines/ida_name' on every LISTING
ROW -- 25,500 sys.modules lookups per 500-row page. 50 such imports across
the file, all pointless: this module is never imported by the client
(codemode_client reads it as TEXT and installs it in the database process),
so the no-IDA house rule that forces function-local imports elsewhere does
not apply here.
Measured honestly, it is worth about 3%: heads(500) best-of-40 goes
9.37ms -> 9.07ms, median 9.73 -> 9.65. A microbenchmark of the bare import
predicted 3.2ms/page and was 10x optimistic -- the A/B is what counts, and
it is a small win, not the big one.
ida_hexrays deliberately stays function-local: it is licence-dependent, and
hoisting it would break the whole remote library for someone without the
decompiler rather than failing only when they decompile. Verified by AST
that every ida_* reference still resolves.
Adds experiments/profile_remote.py, which ships cProfile INTO the database
process -- the only way to see the split between IDA's own calls and our
python, which no client-side timer can show.
Full gate: 1042 passed.
Diffstat (limited to 'docs/CODEMODE_UPSTREAM.md')
0 files changed, 0 insertions, 0 deletions
