Skip to content

Commit 6edae3e

Browse files
committed
dwarf_loader: Make hash table size default to 12, faster than 15
The sweet spot for recent kernels, the default is 15 in the tests below, changing to 12 reduces the time elapsed, make it the new default. $ grep "model name" /proc/cpuinfo model name : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz model name : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz model name : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz model name : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz $ $ sudo perf stat -d -r5 pahole -j --btf_encode_detached vmlinux-j.btf vmlinux Performance counter stats for 'pahole -j --btf_encode_detached vmlinux-j.btf vmlinux' (5 runs): 8,101.71 msec task-clock # 2.752 CPUs utilized ( +- 0.06% ) 1,682 context-switches # 207.610 /sec ( +- 0.98% ) 5 cpu-migrations # 0.592 /sec ( +- 15.31% ) 68,870 page-faults # 8.501 K/sec ( +- 0.02% ) 29,205,269,606 cycles # 3.605 GHz ( +- 0.05% ) 63,448,636,788 instructions # 2.17 insn per cycle ( +- 0.00% ) 15,127,493,299 branches # 1.867 G/sec ( +- 0.00% ) 120,362,476 branch-misses # 0.80% of all branches ( +- 0.11% ) 13,967,000,698 L1-dcache-loads # 1.724 G/sec ( +- 0.00% ) 375,052,289 L1-dcache-load-misses # 2.69% of all L1-dcache accesses ( +- 0.03% ) 91,506,061 LLC-loads # 11.295 M/sec ( +- 0.10% ) 27,905,809 LLC-load-misses # 30.50% of all LL-cache accesses ( +- 0.16% ) 2.94445 +- 0.00188 seconds time elapsed ( +- 0.06% ) $ sudo perf stat -d -r5 pahole --hashbits 12 -j --btf_encode_detached vmlinux-j.btf vmlinux Performance counter stats for 'pahole --hashbits 12 -j --btf_encode_detached vmlinux-j.btf vmlinux' (5 runs): 7,681.15 msec task-clock # 2.702 CPUs utilized ( +- 0.05% ) 1,660 context-switches # 216.114 /sec ( +- 1.02% ) 3 cpu-migrations # 0.365 /sec ( +- 13.36% ) 67,794 page-faults # 8.826 K/sec ( +- 0.05% ) 27,692,748,327 cycles # 3.605 GHz ( +- 0.04% ) 63,041,363,409 instructions # 2.28 insn per cycle ( +- 0.00% ) 15,063,798,404 branches # 1.961 G/sec ( +- 0.00% ) 127,461,737 branch-misses # 0.85% of all branches ( +- 0.11% ) 13,974,527,710 L1-dcache-loads # 1.819 G/sec ( +- 0.00% ) 364,775,664 L1-dcache-load-misses # 2.61% of all L1-dcache accesses ( +- 0.01% ) 83,685,127 LLC-loads # 10.895 M/sec ( +- 0.14% ) 19,073,967 LLC-load-misses # 22.79% of all LL-cache accesses ( +- 0.30% ) 2.842468 +- 0.000561 seconds time elapsed ( +- 0.02% ) $ sudo perf stat -d -r5 pahole -j --btf_encode_detached vmlinux-j.btf vmlinux-5.14.0-0.rc1.20210714git40226a3d96ef.18.fc35.x86_64 Performance counter stats for 'pahole -j --btf_encode_detached vmlinux-j.btf vmlinux-5.14.0-0.rc1.20210714git40226a3d96ef.18.fc35.x86_64' (5 runs): 9,512.30 msec task-clock # 2.741 CPUs utilized ( +- 0.54% ) 1,964 context-switches # 206.469 /sec ( +- 2.60% ) 7 cpu-migrations # 0.736 /sec ( +- 37.25% ) 81,611 page-faults # 8.579 K/sec ( +- 0.08% ) 34,294,568,812 cycles # 3.605 GHz ( +- 0.53% ) 72,897,384,015 instructions # 2.13 insn per cycle ( +- 0.15% ) 17,386,180,039 branches # 1.828 G/sec ( +- 0.15% ) 136,142,139 branch-misses # 0.78% of all branches ( +- 1.06% ) 16,020,787,096 L1-dcache-loads # 1.684 G/sec ( +- 0.19% ) 430,392,585 L1-dcache-load-misses # 2.69% of all L1-dcache accesses ( +- 0.37% ) 107,401,567 LLC-loads # 11.291 M/sec ( +- 0.30% ) 35,172,977 LLC-load-misses # 32.75% of all LL-cache accesses ( +- 0.48% ) 3.4710 +- 0.0243 seconds time elapsed ( +- 0.70% ) $ sudo perf stat -d -r5 pahole --hashbits 12 -j --btf_encode_detached vmlinux-j.btf vmlinux-5.14.0-0.rc1.20210714git40226a3d96ef.18.fc35.x86_64 Performance counter stats for 'pahole --hashbits 12 -j --btf_encode_detached vmlinux-j.btf vmlinux-5.14.0-0.rc1.20210714git40226a3d96ef.18.fc35.x86_64' (5 runs): 8,929.50 msec task-clock # 2.700 CPUs utilized ( +- 0.04% ) 1,907 context-switches # 213.539 /sec ( +- 0.68% ) 4 cpu-migrations # 0.426 /sec ( +- 30.46% ) 80,661 page-faults # 9.033 K/sec ( +- 0.03% ) 32,213,009,827 cycles # 3.607 GHz ( +- 0.03% ) 72,345,614,657 instructions # 2.25 insn per cycle ( +- 0.00% ) 17,290,227,666 branches # 1.936 G/sec ( +- 0.00% ) 142,108,954 branch-misses # 0.82% of all branches ( +- 0.09% ) 15,998,190,852 L1-dcache-loads # 1.792 G/sec ( +- 0.00% ) 417,872,772 L1-dcache-load-misses # 2.61% of all L1-dcache accesses ( +- 0.02% ) 98,061,829 LLC-loads # 10.982 M/sec ( +- 0.24% ) 24,750,223 LLC-load-misses # 25.24% of all LL-cache accesses ( +- 0.17% ) 3.30670 +- 0.00185 seconds time elapsed ( +- 0.06% ) $ Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent d2d83be commit 6edae3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: dwarf_loader.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
static pthread_mutex_t libdw__lock = PTHREAD_MUTEX_INITIALIZER;
5656

57-
static uint32_t hashtags__bits = 15;
57+
static uint32_t hashtags__bits = 12;
5858
static uint32_t max_hashtags__bits = 21;
5959

6060
static uint32_t hashtags__fn(Dwarf_Off key)

0 commit comments

Comments
 (0)