[Rpm-maint] [rpm-software-management/rpm] Callgrind profiling of headerImport (with suggestions for improvement) (#174)
Jeff Johnson
notifications at github.com
Wed Mar 8 15:14:02 UTC 2017
I was asked by mow on #rpm.org to (essentially) "Put up or Shut up"
Attached is the callgrind output for the command
`rpmquery -qavv --nosignature --nodigest --nohdrchk`
on a recent Fedora with rpm-4.13 something which is rate limited by headerImport.
HeaderImport is on the critical code path for every Header.
The top 3 "piggies" are (611,902,317 PROGRAM TOTALS)
138,740,167 * ???:msort_with_tmp.part.0'2 [/usr/lib64/libc-2.24.so]
This can be improved by not calling headerSort. Instead, do an insertion of tags appended from the immutable region.
90,450,776 * ???:0x0000000000017410 [/usr/lib64/librpm.so.7.0.0]
This hotspot is from swabbing integer tag arrays on _EVERY_ headerImport(). Instead, do the swab only where needed on retrieval, in headerGet() (or equiv)
89,550,640 * ???:memcpy at GLIBC_2.2.5 [/usr/lib64/libc-2.24.so]
There is (at least) an extra copy from the buffer returned from Berkeley DB. Instead, make a call to get the #bytes needed, malloc the buffer, and set flags (DBT_USERMEM?) appropriately in a 2nd call to fill the buffer directly.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/174
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170308/90ef4be8/attachment.html>
More information about the Rpm-maint
mailing list