Skip to content

proj_dis_perf_improvements_1

Tsukasa OI edited this page Jul 22, 2022 · 33 revisions

Project: Disassembler Performance Improvements

  1. Disassembler: Use faster hash table
  2. Disassembler: Minor optimizations (batch 1)
  3. Disassembler: Cache instruction class support

Benchmarking System

This benchmark is performed on:

  • Ubuntu 22.04 LTS
  • AMD Ryzen 5 PRO 5650G processor.

In the parallel run, I ran 6 parallel jobs with -j6 (corresponding 6 cores; although the processor has 12 hardware threads, -j12 just slowed the benchmark).

Aggregate Performance Improvements

On disassembling linked RISC-V ELF programs using objdump, performance improvements achieved by this project is usually about 25-32%. Isn't it nice to have?

Note that a few percent may be compensated by future non-performance changes. In fact, some performance changes for objdump -d hurts GDB performance a bit because of extra initialization (which is caused per instruction on the current GDB design).

This is relative to the latest master (commit e4e340a3ff2).

objdump -d (ELF)

Program Improvements Notes
Busybox 1.35.1 (RV64GC) 28.6-31.8%
OpenSBI 1.1 (generic fw_*.elf) 41.8-42.5%
Linux kernel 5.18 (vmlinux) 27.0-28.8%
Linux kernel 5.18 (vmlinux.o) 2.9-14.1% Not finally linked
glibc (libc.so.6) 26.7-30.1%

Due to extra overhead handling many debugging information and symbols, disassembling *.o will be relatively slower.

objdump -d (ELF-based archive)

Program Improvements
glibc (libc.a) 6.6-6.7%
newlib (libc.a) 7.0-10.5%

Due to extra archive file handling, disassembler performance improvements are not large enough.

objdump -D (binary)

Program Improvements
Linux kernel 5.18 (vmlinux) 69.2-89.0%
Random files (/dev/urandom) 87.2-113.2%
1M (1048576) CSR instructions 378.0%

gdb: disas of near all code region

Program Improvements
Linux kernel 5.18 (vmlinux) with debug info 29.7%
Linux kernel 5.18 (vmlinux) without debug info 89.8%
OpenSBI 1.1 (generic fw_*.elf) 77.7-78.4%
1M (1048576) CSR instructions (ELF) 217.0%

Batch: objdump -d on Linux distribution

Serial Run: All /usr/bin Programs

System N Improvements
Ubuntu 22.04 LTS (image for HiFive Unmatched) 563 25.6%
Debian unstable (as of 2022-07-20) 269 25.5%

Parallel Run: Top 100 in Size (including data-only ELFs)

System N Improvements
Ubuntu 22.04 LTS (image for HiFive Unmatched) 100 13.9%
Debian unstable (as of 2022-07-20) 100 4.3%

Parallel Run: All (including data-only ELFs)

System N Improvements
Ubuntu 22.04 LTS (image for HiFive Unmatched) 7666 13.3%
Debian unstable (as of 2022-07-20) 946 5.0%

Batch: objdump -D (as binary) on Linux distribution

Serial Run: All /usr/bin Programs

System N Improvements
Ubuntu 22.04 LTS (image for HiFive Unmatched) 563 48.7%
Debian unstable (as of 2022-07-20) 269 42.2%

Parallel Run: Top 100 in Size (including data-only ELFs)

System N Improvements
Ubuntu 22.04 LTS (image for HiFive Unmatched) 100 71.9%
Debian unstable (as of 2022-07-20) 100 50.5%

Parallel Run: All (including data-only ELFs)

System N Improvements
Ubuntu 22.04 LTS (image for HiFive Unmatched) 7666 56.6%
Debian unstable (as of 2022-07-20) 946 43.1%
Clone this wiki locally