Post #1484998
2026-04-16 07:01 UTC
I'm working on the hash table optimizations I will demonstrate in my talk. I've focused on higher-level changes thus far (mostly related to memory accesses), but I started dipping my toes into some fun micro-optimizations yesterday.
I tried to simplify some hot branch conditions, but the performance didn't improve as much as I expected. So I examined the generated machine code ... but perf annotate is refusing to show me the source lines corresponding to the disassembled instructions. I ended up constructing a behemoth of an objdump invocation to help me analyze the code, and I discovered some options I didn't know about before:
objdump --disassemble --no-show-raw-insn --visualize-jumps=extended-color --disassembler-color=extended --demangle=rust --source --line-numbers --inlines $path | less
You can also make Cargo invoke this for you, via --config "target.'cfg(all())'.runner = "..."; see https://doc.rust-lang.org/stable/cargo/reference/config.html#targettriplerunner.
#programming #rust #optimization
Replies (1)
-
@bal4e@tech.lgbt 2026-04-16 07:04
I wish there was a nice TUI that could provide as much info as this objdump invocation, which could interactively reveal data when it's needed. perf annotate (when it works) doesn't cover --line-numbers or --inlines (AFAIK). The only relevant project I could find was https://github.com/namhyung/das, but it seems to be unmaintained.