This header gsl/pointers.h is included in multiple other headers all over codebase.
Any extra line of code inside gsl/pointers.h makes all project to compile slower.
What was done?
Removed headers <algorithm>, <system_error>, <iosfwd> from gsl/pointers.h
How Has This Been Tested?
Run command 5 times, takes minimum time:
baseline
$ time g++ -o /tmp/a.out gsl/pointers.h -O2 -g -I.
real 0m0,572s
user 0m0,461s
sys 0m0,108s
removed algorithm:
$ time g++ -o /tmp/a.out gsl/pointers.h -O2 -g -I.
real 0m0,505s
user 0m0,398s
sys 0m0,107s
removed algorithm and system_error:
real 0m0,332s
user 0m0,265s
sys 0m0,067s
disabled iostream:
$ time g++ -o /tmp/a.out gsl/pointers.h -O2 -g -I. -D GSL_NO_IOSTREAMS
real 0m0,316s
user 0m0,256s
sys 0m0,060s
as a result, overall project compilation time is also improved: make clean ; sleep 3s ; time make -j20
real 5m42,934s
user 80m35,127s
sys 6m40,735s
real 5m28,862s
user 75m31,931s
sys 6m32,591s
Breaking Changes
N/A
Checklist:
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have added or updated relevant unit/integration/functional/e2e tests
[ ] I have made corresponding changes to the documentation
[x] I have assigned this pull request to a milestone
Issue being fixed or feature implemented
This header
gsl/pointers.h
is included in multiple other headers all over codebase. Any extra line of code inside gsl/pointers.h makes all project to compile slower.What was done?
Removed headers
<algorithm>
,<system_error>
,<iosfwd>
from gsl/pointers.hHow Has This Been Tested?
Run command 5 times, takes minimum time:
baseline
removed algorithm:
removed algorithm and system_error:
disabled iostream:
as a result, overall project compilation time is also improved:
make clean ; sleep 3s ; time make -j20
Breaking Changes
N/A
Checklist: