-
Notifications
You must be signed in to change notification settings - Fork 1
riscv_dis_opts_batch_1
- Status: WITHDRAWN
(superseded by Disassembler: Core Optimization 1-1 (Hash table and Caching)) - Branch:
riscv-dis-opts-batch-1
- Tracking PR: #28 (view Pull Request and Diff)
-
Disassembler: Fix address printer
It also touches the core disassembler. - Pending: Disassembler: Implement "generic subsets" (PATCH v1 only)
It also changes the core disassembler. Note that the latest version depends on this patchset. - Pending (RFC): Disassembler: Check shift amount against XLEN (Idea 1)
It also changes the core disassembler.
- Disassembler: Use faster hash table
- Disassembler: Minor optimizations (batch 1)
- Disassembler: Cache instruction class support
- Disassembler: Use
xlen
onADDIW
address sequence
To improve the core disassembler (both for performance and feature), this patchset now implements several optimizations for further performance on objdump and GDB.
It will be a prerequisite of upcoming core disassembler changes:
- Disassembler:
RV32E
support - Disassembler: Add overridable
priv-spec
andarch
options - Disassembler: Implement "generic subsets"
Changes in this Patchset:
- Various minor fixes (originally in... (1) (2))
- Split match/print steps on the disassembler (originally in "generic subsets")
- One time CSR hash table initialization (previously in minor optimizations batch 1)
- Minimize disassembler state initialization (general/arch-related) (previously in minor optimizations batch 1)
- Use faster hash table on disassembling
- Cache instruction support
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).
On disassembling linked RISC-V ELF programs using objdump
, performance improvements achieved by this patchset is usually about 25-33%. 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 at the time of the benchmack (commit b82817674f4
).
Program | Improvements | Notes |
---|---|---|
Busybox 1.35.1 (RV64GC ) |
30.6-32.9% | |
OpenSBI 1.1 (generic fw_*.elf ) |
43.7-43.9% | |
Linux kernel 5.18 (vmlinux ) |
28.4-30.2% | |
Linux kernel 5.18 (vmlinux.o ) |
3.3-15.7% | Not finally linked |
glibc (libc.so.6 ) |
28.0-32.8% |
Due to extra overhead handling many debugging information and symbols, disassembling *.o
will be relatively slower.
Some overhead will be handled in the next batch of the disassembler optimization.
Program | Improvements |
---|---|
glibc (libc.a ) |
8.4-8.7% |
newlib (libc.a ) |
9.4-13.2% |
Due to extra archive file handling, disassembler performance improvements are not large enough.
Some overhead will be handled in the next batch of the disassembler optimization.
Program | Improvements |
---|---|
Linux kernel 5.18 (vmlinux ) |
69.8-95.6% |
Random files (/dev/urandom ) |
92.2-114.7% |
1M (1048576) CSR instructions | 378.8% |
Program | Improvements |
---|---|
Linux kernel 5.18 (vmlinux ) with debug info |
30.8% |
Linux kernel 5.18 (vmlinux ) without debug info |
90.2% |
OpenSBI 1.1 (generic fw_*.elf ) |
65.8-66.4% |
1M (1048576) CSR instructions (ELF) | 204.1% |
System | Path | N | Improvements |
---|---|---|---|
Ubuntu 22.04 LTS (image for HiFive Unmatched) | /usr/bin |
563 | 27.2% |
Debian unstable (as of 2022-07-20) | /usr/bin |
269 | 27.4% |
Ubuntu 22.04 LTS (image for HiFive Unmatched) | /usr/lib |
6797 | 16.2% |
Debian unstable (as of 2022-07-20) | /usr/lib |
548 | 12.1% |
System | N | Improvements |
---|---|---|
Ubuntu 22.04 LTS (image for HiFive Unmatched) | 7666 | 13.8% |
Debian unstable (as of 2022-07-20) | 946 | 6.7% |
System | Path | N | Improvements |
---|---|---|---|
Ubuntu 22.04 LTS (image for HiFive Unmatched) | /usr/bin |
563 | 50.5% |
Debian unstable (as of 2022-07-20) | /usr/bin |
269 | 43.4% |
System | N | Improvements |
---|---|---|
Ubuntu 22.04 LTS (image for HiFive Unmatched) | 7666 | 58.1% |
Debian unstable (as of 2022-07-20) | 946 | 45.3% |