Clang's optimizer spends a really long time on these tests at -O2, so we now
use -O0 instead. This reduces the -j32 time for lib/googletest/test from 131s
to 29s. Using -O0 also reduces the disk usage from 144MB (at -O2) / 92MB (at
-O1) to 82MB.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Do we even need this in default installs? As in, what happens if this does not get compiled at all?
Yes I'd also vote for turning this off by default. I have an open review that I need to update: https://reviews.freebsd.org/D26067
Running the tests at -O2 in QEMU amd64 took:
44.52 real 27.28 user 13.96 sys
Changing it to -O1 makes it
91.80 real 73.32 user 14.28 sys
and -O0 results in
109.46 real 90.08 user 14.38 sys
So we might as well use -O0 since it doesn't seem to make much of a run time difference but has a big impact on compile time :)
O0:
82M /home/alr48/cheri/output/freebsd-amd64/usr/tests/lib/googletest/
O1:
92M /home/alr48/cheri/output/freebsd-amd64/usr/tests/lib/googletest/
O2:
144M /home/alr48/cheri/output/freebsd-amd64/usr/tests/lib/googletest/
So it seems like the aggressive inlining at -O2 also increases the disk space requirements.
No blocking concerns.
lib/googletest/tests/Makefile.inc | ||
---|---|---|
10–13 ↗ | (On Diff #78489) | I'd add "At time of writing" to this statement and mention "amd64"/"arm64" for reference, given that this might change in the future or fluctuate. |
15–17 ↗ | (On Diff #78489) | What does -g0 do? I really wish the clang manpage/documentation was better about describing this like gcc's is. |