Page MenuHomeFreeBSD

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

Authored by jrm on Mon, Aug 17, 8:30 PM.
Tags
None
Referenced Files
F168379315: D58899.id184216.diff
Thu, Aug 27, 9:18 PM
F168356664: D58899.id.diff
Thu, Aug 27, 6:37 PM
Unknown Object (File)
Thu, Aug 27, 1:24 AM
Unknown Object (File)
Wed, Aug 26, 1:25 AM
Unknown Object (File)
Wed, Aug 26, 1:14 AM
Unknown Object (File)
Wed, Aug 26, 12:27 AM
Unknown Object (File)
Tue, Aug 25, 12:51 AM
Unknown Object (File)
Sat, Aug 22, 4:34 AM
Subscribers
None

Details

Reviewers
mandree
bapt
Group Reviewers
portmgr
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 75659
Build 72542: arc lint + arc unit

Event Timeline

jrm requested review of this revision.Mon, Aug 17, 8:30 PM
jrm created this revision.
This revision is now accepted and ready to land.Tue, Aug 18, 11:47 AM