Closed Bug 1654182 Opened 5 years ago Closed 5 years ago

check_binary is slow on Linux builds

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox80 fixed)

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

I found this out while building like automation locally for bug 1654123.

Iterating symbols is actually expensive because of all the line
splitting. So iterating over all symbols 4 times is actually a huge
waste of time.

Instead, iterate over them once, doing all the version checks at once
for each of them.

This brings down the time spent in check_binary from 2:25 to 0:45 on my
machine.

The way check_binary currently works is the result of many years of
changes, but some of the more recent ones actually make some of the
earliest ones unnecessary.

For instance, bug 1541792 removed the need to use iter_symbols on
non-Linux platforms. So we remove support for non-Linux (non-ELF,
really) platforms in iter_symbols (and rename the function to reflect
that).

The main reason we look at the complete symbols table is that before bug
1541792, we needed to look at that table for _NSModule symbols.

In bug 1516228, we also made everything llvm-objdump to limit the
differences cross-platform, but that's not necessary anymore per the
previous change.

llvm-objdump doesn't support getting only the dynamic symbols table, so
we go back to what we were using before bug 1516228, namely readelf,
while preserving a code path to use the complete symbols table for the
networking test on libgkrust.a, which doesn't have a dynamic symbols
table.

With this change, check_binary goes from 45s to 0.2s on my machine.

Strictly speaking, with the last patch, the first patch is essentially useless, but that's the first thing I tried and it still seemed like a nice thing to do.

Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/6100f0d3c0ad Reduce the amount of work done for binary compatibility check. r=froydnj https://hg.mozilla.org/integration/autoland/rev/13ab8f6d24bf Remove support for iterating symbols on non-Linux platforms. r=froydnj https://hg.mozilla.org/integration/autoland/rev/205329cc5f30 Only look at the dynamic symbols table for the version checks. r=froydnj
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/d2787ae2b210 Reduce the amount of work done for binary compatibility check. r=froydnj https://hg.mozilla.org/integration/autoland/rev/baa743f59bcc Remove support for iterating symbols on non-Linux platforms. r=froydnj https://hg.mozilla.org/integration/autoland/rev/b26f94c6bfde Only look at the dynamic symbols table for the version checks. r=froydnj
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: