Skip to content

Reduce compilation time of the QC project#219

Merged
knopers8 merged 8 commits intoAliceO2Group:masterfrom
knopers8:reduce-compile-time
Aug 7, 2019
Merged

Reduce compilation time of the QC project#219
knopers8 merged 8 commits intoAliceO2Group:masterfrom
knopers8:reduce-compile-time

Conversation

@knopers8
Copy link
Collaborator

Starting off from #180 as a point of reference, to avoid too much work when merging changes. The compilation time measurements are done on a machine with Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (4 CPUs, 1 thread per core) and 8GB of memory.
The results for the version with no changes (3 times each, to see how random it can get):

time -p make -j 1 install
real 516.83
user 476.91
sys 39.67
real 518.56
user 477.19
sys 41.26
real 524.67
user 483.87
sys 40.47
time -p make -j 4 install
real 233.00
user 588.00
sys 51.27
real 178.04
user 569.57
sys 47.92
real 182.98
user 565.65
sys 46.99

@knopers8 knopers8 changed the title Reduce compilation time of the QC project [WIP] Reduce compilation time of the QC project Jul 25, 2019
@knopers8 knopers8 force-pushed the reduce-compile-time branch from 1dea1e1 to 68d6d43 Compare July 26, 2019 12:15
@knopers8
Copy link
Collaborator Author

knopers8 commented Jul 26, 2019

After the first round, which involved adding headers which before were used indirectly, deleting the unnecessary ones and using the correct inclusion type ("" or <>), these are the results:
time -p make -j 1 install
real 585.37
user 537.67
sys 46.30
time -p make -j 4 install
real 262.96
user 659.00
sys 58.25
This is clearly a downgrade, probably due to more diligent inclusions. Now, let's see how much we can improve by putting forward declarations where it is possible.
EDIT: These results are not reliable, the test setup was not stable enough, see below for test results on a server machine.

@knopers8
Copy link
Collaborator Author

knopers8 commented Jul 26, 2019

After forward declarations and moving some function definitions to source files:
time -p make -j 1 install
real 578.93
user 525.55
sys 46.49
time -p make -j 4 install
real 221.72
user 600.49
sys 56.16
A bit better, but still worse than at the beginning. It would be good to confirm the results on a server machine, though as for now, it doesn't look promising.
EDIT: These results are not reliable, the test setup was not stable enough, see below for test results on a server machine.

@knopers8
Copy link
Collaborator Author

knopers8 commented Jul 29, 2019

I tried it on aido2qc10 (Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz, 32 CPUs, 128GB RAM):

master:
time -p make -j 1 install
real 530.61
user 489.13
sys 40.41
time -p make -j 4 install
real 163.05
user 515.02
sys 41.32
time -p make -j 32 install
real 68.43
user 792.75
sys 55.56

68d6d43 (deleting unnecessary headers and adding ones which were previously dangerously transient):

time -p make -j 1 install
real 516.40
user 475.64
sys 40.17
time -p make -j 4 install
real 157.60
user 504.50
sys 41.60
time -p make -j 32 install
real 65.02
user 772.59
sys 55.34

649d280 (forward declarations in the Framework, current progress):

time -p make -j 1 install
real 500.85
user 461.13
sys 38.93
time -p make -j 4 install
real 154.38
user 489.81
sys 39.15
time -p make -j 32 install
real 63.52
user 765.96
sys 53.57

Now the improvements are quite evident and coherent for different number of jobs specified, so I would blame the previous decreases on that test setup (a PC, IDE and browser open).

@knopers8
Copy link
Collaborator Author

knopers8 commented Jul 30, 2019

7009614 (more forward declarations in Framework and header cleanup in tests):

time -p make -j 1 install
real 476.43
user 437.92
sys 37.96
time -p make -j 4 install
real 139.18
user 464.00
sys 39.18
time -p make -j 32 install
real 53.28
user 725.59
sys 51.64

@knopers8
Copy link
Collaborator Author

7198e59:

time -p make -j 1 install
real 474.55
user 435.70
sys 38.33
time -p make -j 4 install
real 139.30
user 462.48
sys 38.89
time -p make -j 32 install
real 53.65
user 719.47
sys 52.17

The influence of the changes in Modules was minimal.

@knopers8
Copy link
Collaborator Author

d9f2ef4:

time -p make -j 1 install
real 471.57
user 433.55
sys 37.33
time -p make -j 4 install
real 136.46
user 458.56
sys 39.35
time -p make -j 32 install
real 52.29
user 725.33
sys 51.87

A slight improvement by using = default ctors and dtors wherever possible.

@knopers8
Copy link
Collaborator Author

knopers8 commented Aug 6, 2019

fef7fe1:

time -p make -j 1 install
real 468.86
user 438.69
sys 29.27
time -p make -j 4 install
real 131.24
user 450.72
sys 31.97
time -p make -j 32 install
real 50.97
user 707.96
sys 43.25

Conflicts:
	Framework/src/runQC.cxx
@knopers8 knopers8 changed the title [WIP] Reduce compilation time of the QC project Reduce compilation time of the QC project Aug 6, 2019
@knopers8
Copy link
Collaborator Author

knopers8 commented Aug 7, 2019

Overall, we have 12% improvement for -j 1, 20% for -j 4 and 26% for -j 32 if we compare the "real" time.

Travis fails because of:

E: Package 'cmake' has no installation candidate
E: Package 'graphviz' has no installation candidate
apt-get.diagnostics
apt-get install failed
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install cmake doxygen doxygen-doc doxygen-latex doxygen-gui graphviz" failed and exited with 100 during .

I have applied clang-format to the PR, other builds are passing. Merging.

@knopers8 knopers8 merged commit 86a002d into AliceO2Group:master Aug 7, 2019
@knopers8 knopers8 deleted the reduce-compile-time branch August 7, 2019 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant