public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug general/31763] New: eu-readelf -r is super slow at packed relocation processing
@ 2024-05-20 18:41 ajax at redhat dot com
  2024-05-20 19:03 ` [Bug general/31763] " mark at klomp dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ajax at redhat dot com @ 2024-05-20 18:41 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=31763

            Bug ID: 31763
           Summary: eu-readelf -r is super slow at packed relocation
                    processing
           Product: elfutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
          Assignee: unassigned at sourceware dot org
          Reporter: ajax at redhat dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

After upgrading to F40, I was pleased to find that packed relocations were
enabled, but one of my tools uses `eu-readelf -r` and apparently packed relocs
are super slow:

========
# What are we dealing with?
neo:~% eu-readelf -d /usr/lib64/libcrypto.so.3 | grep ^..REL
  RELA              0x000000000004acc8
  RELASZ            168 (bytes)
  RELAENT           24 (bytes)
  RELR              0x000000000004bc88
  RELRSZ            6000 (bytes)
  RELRENT           8 (bytes)

# Not too huge. How bad is it?
neo:~% time eu-readelf -r /usr/lib64/libcrypto.so | wc -l   
17904
eu-readelf -r /usr/lib64/libcrypto.so  5.80s user 0.00s system 99% cpu 5.812
total
wc -l  0.00s user 0.00s system 0% cpu 5.811 total

# That's... not good. How does the competition do?
neo:~% time readelf -r /usr/lib64/libcrypto.so | wc -l   
17905
readelf -r /usr/lib64/libcrypto.so  0.01s user 0.01s system 95% cpu 0.014 total
wc -l  0.00s user 0.00s system 25% cpu 0.013 total

# That's worse. Did it happen in F39?
neo:~% time toolbox run -c fedora39 eu-readelf -r /usr/lib64/libcrypto.so | wc
-l
17006
toolbox run -c fedora39 eu-readelf -r /usr/lib64/libcrypto.so  0.00s user 0.01s
system 3% cpu 0.348 total
wc -l  0.00s user 0.00s system 1% cpu 0.347 total

# Nope, even the container overhead doesn't come close.
# Does it happen with F40's elfutils but F39's libcrypto?
neo:~% toolbox run -c fedora39 cat /usr/lib64/libcrypto.so > f39-libcrypto.so
neo:~% time eu-readelf -r ./f39-libcrypto.so | wc -l
17006
eu-readelf -r ./f39-libcrypto.so  0.00s user 0.00s system 93% cpu 0.010 total
wc -l  0.00s user 0.00s system 37% cpu 0.009 total

# Nope. What does f39's libcrypto's reloc info look like?
neo:~% eu-readelf -d ./f39-libcrypto.so | grep ^..REL          
  RELA              0x00000000000494a0
  RELASZ            404592 (bytes)
  RELAENT           24 (bytes)
  RELACOUNT         16851
========

6 seconds is "bad but not awful", but I discovered this on libLLVM where it's
more like eight minutes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-22 13:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-20 18:41 [Bug general/31763] New: eu-readelf -r is super slow at packed relocation processing ajax at redhat dot com
2024-05-20 19:03 ` [Bug general/31763] " mark at klomp dot org
2024-05-21 13:30 ` mark at klomp dot org
2024-05-21 13:39 ` ajax at redhat dot com
2024-05-22  7:51 ` fweimer at redhat dot com
2024-05-22 13:48 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).