Skip to content

proj_dis_perf_improvements_1

Tsukasa OI edited this page Jul 21, 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 files using objdump, performance improvements achieved by this project is usually about 25-35%. Isn't it nice to have?

Note that a few percent may be compensated by future non-performance changes.

This is relative to the latest master (commit 1bc99604e84).

objdump -d (ELF)

Program Improvements Notes
Busybox 1.35.1 (RV64GC) 29.9-34.7%
OpenSBI 1.1 (generic fw_*.elf) 42.9-43.1%
Linux kernel 5.18 (vmlinux) 26.2-28.1%
Linux kernel 5.18 (vmlinux.o) (-1.0)-9.7% Not finally linked
glibc (libc.so.6) 26.1-30.5%

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) 0.3-0.6%
newlib (libc.a) 0.2-3.8%

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

objdump -D (binary)

Program Improvements
Linux kernel 5.18 (vmlinux) 93.7-116.5%
Random files (/dev/urandom) 119.8-123.0%
1M (1048576) CSR instructions 390.6%

gdb: disas of near all code region

Program Improvements
Linux kernel 5.18 (vmlinux) with debug info 26.8%
Linux kernel 5.18 (vmlinux) without debug info 83.8%
OpenSBI 1.1 (generic fw_*.elf) 73.0-73.4%
1M (1048576) CSR instructions (ELF) 209.5%

Batch: objdump -d on Linux distribution

Serial Run: All /usr/bin Programs

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

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

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

Parallel Run: All (including data-only ELFs)

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