[llvm] [llvm-objdump] Optimize live element tracking (PR #158763)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 1 11:11:10 PDT 2025
gulfemsavrun wrote:
> Thanks. Your numbers are certainly compelling. Is it possible to get peak memory usage too? I imagine the cost is small comparatively, but would be interesting to see them, since you'll be increasing the usage with this change (the age old memory versus speed trade-off).
>
I used the `/usr/bin/time` -v utility to measure the `Maximum Resident Set Size (RSS)` in kilobytes, which I think represents the peak memory usage.
**Default (No flag)**
```
$ /usr/bin/time -v llvm-objdump --disassemble kernel_x64/vmzircon
Maximum resident set size (kbytes): 37,980
```
**Linear search (--debug-inlined-funcs)**
```
$ /usr/bin/time -v llvm-objdump --disassemble --debug-inlined-funcs=limits-only kernel_x64/vmzircon
Maximum resident set size (kbytes): 343,624
```
**Optimized maps (--debug-inlined-funcs)**
```
$ /usr/bin/time -v llvm-objdump --disassemble --debug-inlined-funcs=limits-only kernel_x64/vmzircon
Maximum resident set size (kbytes): 341,708
```
AFAICT, use of `-debug-inlined-funcs` flag, regardless of the underlying implementation, introduces a significant increase in peak memory usage over the default disassembly mode. However, the `optimized maps` approach does not introduce any additional memory cost compared to the original `linear search` method.
> I've started reviewing this, but will need to come back to finish off. I've left a couple of comments for you to get on with.
Thank you very much!
https://github.com/llvm/llvm-project/pull/158763
More information about the llvm-commits
mailing list