Making compilation faster&
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Making compilation faster&
I had an idea.
If you have a lot of code files, then why not start each 'gcc' command as a new process (by appending & to the end of the command)?
This may only work on a fast computer.
Problems:
1) The code files all need to be there when linking
Solution: When all commands are started, right before linking add a 'sleep 0.5' command which pauses for 1/2 second while the commands finish.
For me:
All my code files compiled in 4 seconds when doing one-at-a-time processing.
When each is a new process: 1.6 seconds. Thats a factor of 2.5! Much faster.
-JL
If you have a lot of code files, then why not start each 'gcc' command as a new process (by appending & to the end of the command)?
This may only work on a fast computer.
Problems:
1) The code files all need to be there when linking
Solution: When all commands are started, right before linking add a 'sleep 0.5' command which pauses for 1/2 second while the commands finish.
For me:
All my code files compiled in 4 seconds when doing one-at-a-time processing.
When each is a new process: 1.6 seconds. Thats a factor of 2.5! Much faster.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
What do you mean?I'm officially stunned.. as is Alboin.
Are you serious? Rolling Eyes
It works on my computer, and I like to not waste time.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
you could use a makefile with the -j option.
http://unixhelp.ed.ac.uk/CGI/man-cgi?make
http://unixhelp.ed.ac.uk/CGI/man-cgi?make
-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If
there is more than one -j option, the last one is effective. If
the -j option is given without an argument, make will not limit
the number of jobs that can run simultaneously.
The cake is a lie | rackbits.com
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Well, then can you control what links when?
...And I had some fun with the make file for 5 min.
-JL
...And I had some fun with the make file for 5 min.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
whatever, I was bored.
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 50
- Joined: Sun Dec 02, 2007 1:24 pm
- Libera.chat IRC: elfenix
- Location: United States
- Contact:
Errr.....
Wondering why you aren't using make files... Or Visual Studio Projects.... Or Sconscripts....
See - 'make -j', "Enable Parallel Builds", 'scons -j'
Edit: guess you were.... go back to your original Makefile and use,
make -j 4 (target) - if you have dual core or on single core
make -j 8 (target) - if you have more...
Further edit: not my day, I see this was already mentioned...
Wondering why you aren't using make files... Or Visual Studio Projects.... Or Sconscripts....
See - 'make -j', "Enable Parallel Builds", 'scons -j'
Edit: guess you were.... go back to your original Makefile and use,
make -j 4 (target) - if you have dual core or on single core
make -j 8 (target) - if you have more...
Further edit: not my day, I see this was already mentioned...