Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #6039: fix: optimize compilation time of gsl library
dc59cbc fix: optimize includes in gsl/pointer.h to speed up compile time (Konstantin Akimov) d5e32e1 fix: disable gsl iostream feature for faster compile time (Konstantin Akimov) Pull request description: ## 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.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 ACKs for top commit: UdjinM6: utACK dc59cbc Tree-SHA512: 353d79c0e297c92e823972b53daaaed42494554ce550ea800ce8aa6990c704cedfbcb922e1d735eb8fc01ad14ffa873d86cdbc4d3731d841496392bb74286d33
- Loading branch information