gtest's autotools build script is compiling gtest and
its tests with -O2. As a result, it takes a lot of time to do a clean
make - much more than it takes to run the built tests:
$ mkdir out && cd out
$ time ../configure
real 0m49.203s
$ time make
real 1m1.742s
$ time make check
real 2m41.480s
$ time make check
real 0m10.236s
Note that:
- the first 'make check' takes 2m41s while the second one takes 10s,
suggesting the the compilation of the tests takes 2m31s while running
them only takes 10s.
So most of the build time is spent on compiling the tests, followed by
the time on compiling gtest itself. By turning off -O2, we can speed
up both.
I repeated the experiment with -O0 in a fresh output directory.
The result:
$ time make
real 0m45.791s
$ time make check
real 1m17.178s
$ time make check
real 0m9.791s
So the total build & test time (make && make check) has come down from
3m43s to 2m3s, while the test execution time is still ~10s.
Original issue reported on code.google.com by zhanyong...@gmail.com on 6 Feb 2009 at 6:27
Original issue reported on code.google.com by
zhanyong...@gmail.com
on 6 Feb 2009 at 6:27