mtiller / ModelicaBook

Source for my new Modelica Book
https://mbe.modelica.university
Other
97 stars 71 forks source link

Generate exes with a single script? #416

Closed mtiller closed 5 years ago

mtiller commented 5 years ago

Not sure if this is possible (need to try it). But if it is, it could really speed up compilation. Would avoid having to load the MSL over and over again for each case.

sjoelund commented 5 years ago

Generally, doing the work in parallel helps more than trying to do everything in a single process (especially if makefiles are used and you don't compile the models over and over again). And given the number of CPU cores in modern workstation, you probably want to do more work in parallel.

mtiller commented 5 years ago

Well, I'm not sure doing stuff in parallel is much of an option. First, I'm concerned about the compilation time for CI. In that environment, you don't have many cores or much memory. Second, if if I did have the CPUs and memory, the way things are currently set up, I'm not sure there is a make -j N ... option here (I'll have to check). But for sure, loading the MSL all the time is overhead. I'll do some benchmarking and try to take your optimizations into account. Thanks.

mtiller commented 5 years ago

I tried doing a make -j 4 ... in my builds, but I get errors. Doing them all in one shot did give a small speed up. But I ultimately took a different approach and instead tried to make the builds smarter by looking at git hashes. I think the approach, while overly conservative, is sound and helps eliminate computationally intensive steps in local builds. In other words, the only thing better than building faster is not building at all.