Page MenuHomeFreeBSD

Mk/Scripts/qa.sh: Filter baselibs() input to improve performance
ClosedPublic

Authored by jrm on Mon, Aug 17, 8:30 PM.
Tags
None
Referenced Files
F167428823: D58900.id.diff
Fri, Aug 21, 4:29 PM
Unknown Object (File)
Thu, Aug 20, 3:24 PM
Unknown Object (File)
Wed, Aug 19, 9:21 AM
Unknown Object (File)
Tue, Aug 18, 11:23 PM
Unknown Object (File)
Tue, Aug 18, 8:05 PM
Unknown Object (File)
Tue, Aug 18, 7:04 PM
Unknown Object (File)
Tue, Aug 18, 5:55 PM
Unknown Object (File)
Tue, Aug 18, 2:54 PM
Subscribers
None

Details

Summary

After the baselibs() fix in f0f863b1a2d6, readelf is executed for each
result from find(1). There are two concerns with this fix:

  1. -exec readelf -d {} \; drops the filename from the error messages

readelf prints "File: <name>" headers only when it is supplied with two
or more files, and baselibs() uses ${file} from those headers. So, the
two err() messages in baselibs() will break.

This is moot for now, though, because nothing in the ports tree can
trigger these errors. Those base soname versions for libarchive and
libedit are long gone.

  1. Performance hit with one readelf execution per staged file

The costs are high for ports that stage many files. For
emulators/linux_base-rl9, the find returns over 30k hits that the while
loop must iterate over. It took about 15s for baselibs() to process
these files on an i7-10710U build system.

To fix these issues, use a filter similar to the one used by
proxydeps(). This way, only ELF objects are fed to one instance of
readelf, and the timing for baselibs() to process
emulators/linux_base-rl9 drops to about 1.5s.

PR: 296889
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable