diff options
| author | user <user@clank> | 2026-08-07 02:12:27 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-07 02:12:27 +0200 |
| commit | 414873898f236cdc1ab0d7c6a83f1a58f57f2d6b (patch) | |
| tree | 3609de900f289cb2b3538d427c1c20089ca75854 /idatui/app.py | |
| parent | Three micro-wins on the listing-row path: merge the colour-tag and operand-ta... (diff) | |
| download | ida-tui-414873898f236cdc1ab0d7c6a83f1a58f57f2d6b.tar.gz ida-tui-414873898f236cdc1ab0d7c6a83f1a58f57f2d6b.tar.xz ida-tui-414873898f236cdc1ab0d7c6a83f1a58f57f2d6b.zip | |
Two hot-path fixes found by profiling the plain-line builder: the opcode-bytes column used a per-byte f-string generator where bytes.hex(' ').upper() does it in one C call (12x), and ListingModel._phys/_head_index_at re-imported bisect on every call. _line_plain 2.64 -> 1.57 us/row.
Result: {"status":"keep","total_ms":19476.3,"lg_boot_ms":756.3,"lg_decomp_ms":2495.1,"lg_graph_ms":946,"lg_hex_ms":905.4,"lg_index_ms":72,"lg_listing_cold_ms":547.5,"lg_listing_warm_ms":410.4,"lg_nav_ms":6723.4,"lg_palette_ms":5,"lg_render_ms":218.8,"lg_search_ms":2312.4,"pure_graph_ms":239.5,"sm_boot_ms":535.3,"sm_decomp_ms":616.4,"sm_graph_ms":682.2,"sm_hex_ms":824.9,"sm_index_ms":0,"sm_listing_cold_ms":258.9,"sm_listing_warm_ms":261,"sm_nav_ms":339.5,"sm_palette_ms":0.3,"sm_render_ms":248.7,"sm_search_ms":77.3,"fails":0}
Diffstat (limited to 'idatui/app.py')
| -rw-r--r-- | idatui/app.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/idatui/app.py b/idatui/app.py index 0af47c0..d07a188 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -901,11 +901,16 @@ class ListingView(SearchMixin, NavMixin, ColumnCursor, ScrollView, can_focus=Tru def _op_bytes_text(self, h: Head) -> str: """Hex bytes for ``h``, truncated with an ellipsis in 'limited' mode so a - long x86-64 instruction doesn't blow out the column.""" + long x86-64 instruction doesn't blow out the column. + + ``bytes.hex(" ")`` rather than a per-byte f-string generator: this is + called for every row of every plain line, and search builds the plain + line for the whole segment. + """ raw = h.raw or b"" if self._op_mode == 1 and len(raw) > _OP_LIMIT: - return " ".join(f"{b:02X}" for b in raw[:_OP_LIMIT]) + "\u2026" - return " ".join(f"{b:02X}" for b in raw) + return raw[:_OP_LIMIT].hex(" ").upper() + "\u2026" + return raw.hex(" ").upper() @staticmethod def _span_segments(h: Head, fallback: Style): |
