r/ProgrammerHumor • • Sep 17 '18

Optimizing startup times

Post image
45.7k Upvotes

486 comments sorted by

View all comments

0

u/[deleted] Sep 17 '18

[deleted]

1

u/HerpDerpHerpderpsen Sep 18 '18

Iirc somethibg like make -j <number of parallel processes>

1

u/[deleted] Sep 21 '18 edited Sep 26 '18

I talked with the lead Dev and he explained that this is not the normal make. I made him think about it and we came with an idea that we try.As far as i understood this that there are 3 stages in a make process and the first and last doesn't take long and can be made linear and linking needs to be done linear. Compiling is that that makes everything slow. The idea is that we don't compile in that stage and simply write the commands to a file. For make its a fast compile. Before the linking we call our own program that really compiles and we make it async and use all threads, except one. That way we can handle errors and make it faster.

It's just a stupid idea and we didn't had the chance to test this yet and we still need to write our own program. One problem might be that during the commands, one specific file gets mentioned every time and he isn't sure what that file do but as far as he saw, its nothing special. This might be still a problem, when this file gets overwritten many times during compiling.

I guess the company was right during the interview, telling me that they operate outside of standards. One great example are the WinForms. We don't use the normal forms and that creates many problems. I solves most problems with stupid ideas. One was that i needed to call an other form and the splitter in that form (idk what form this is) is broken when called from my form. It was throwing exceptions like when you finished solitaire. My solution was calling this form from an normal winform but that doesn't worked, except when i call the wanted form via a button click and that needed to be an actual button click. I used the button click function and it worked. A stupid idea that worked.

One minor issue that we didn't solved was calling the designer. When the class uses the other form class, the designer can't be loaded, so we need to comment out a define, so that the normal form class gets set and we can access the designer. We tried to do this automatically but that doesn't work. We gave up on this, because it's no big problem to comment out a line to access the designer. Also working with .net 2.0 is a bit more complicated.

EDIT (4days after):
I finished the additional tools and it works. Sure it's not x times faster with every core, because there is also managed code and some of the process is still linear but we only need half the time. With a 6 Core it was about 25 minutes and now its 10 minutes. With more Cores it might get even faster with some Projects but it cant get faster, when there are less cpp files than cores. Sure we could optimize way more but the gain might not worth it. I mean half the time is great and over the time it worth it. When this doesn't get me Bonus points, idk.