dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

fix: optimize compilation time of gsl library #6039

Open knst opened 1 month ago

knst commented 1 month ago

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:

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:

UdjinM6 commented 1 month ago

Let's wait for the upstream PR to be merged first

knst commented 1 month ago

Let's wait for the upstream PR to be merged first

for reference: https://github.com/microsoft/GSL/pull/1153