Jump to content

Change Mode

Get the most from your multicore processor


Bruce
 Share

Recommended Posts

If you like to compile your own software and a have a dual or quad core processor, here is a great tip. You can take advantage of all those processor cores and double the speed of compiling your own software.

 

After running configure you get to the make stage of building your application.

 

Don't just run make, add the number of processor cores you have +1 to the command like this.

 

For instance on my dual core I would run make -j 3 this spawns 2 processes and will drastically increase the speed by using both cores of my processor, and decreases the time it takes to build all the files.

 

My quad core processor command would be........make -j 5

 

An example of the speed increase with a quad core processor.

 

I chose to test with digikam, as previous experience tells me that this application takes a long time to compile, especially now that digikam and digikam plugins are nonger two separate applications, but the plugins have been included in the tar ball.

 

Just running the command make took 9 minutes and 50 seconds to complete.

 

Running make -j 5 took a total of 4 minutes and 30 seconds.

 

That my friends is an increase in speed that is just flat amazing.

 

When I did the test, I expected a minute or two difference but was shocked to see the computer literally double in speed :tup:

Link to comment
Share on other sites

  • 2 weeks later...

Well I do believe if I were using a Debian based distro I would be compiling even more from source as debian based distros seem to be behind other main stream distros when it comes to the latest releases of software. In other words they use older versions then most other distros.

 

I compile from source usually because I use some applications from "svn" or RC candidates. In other words "bleeding edge".

 

Not many but Digikam is one application that I almost compile from source.

Link to comment
Share on other sites

  • 3 months later...
  • 6 months later...
  • 3 months later...
  • 1 month later...

kram' that's a good question, i have seen commands for mencoder that utilize up to four cores, for now' check out multi threading for avidemux.

 

http://avidemux.org/admWiki/index.php?title=Multithreading

 

but for one cpu

 

mencoder INPUT -oac lavc -ovc lavc -of lavf -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=900:acod ec=libfaac -af lavcresample=24000 -vf scale=368:208,harddup -lavfopts format=psp -ofps 30000/1001 -o OUTPUT

dual core

 

mencoder INPUT -oac lavc -ovc lavc -of lavf -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=900:thre ads=2:acodec=libfaac -af lavcresample=24000 -vf scale=368:208,harddup -lavfopts format=psp -ofps 30000/1001 -o OUTPUT

broken down, this can be used for a psp or whatever accepts the res and frame rates !

 

 

-ovc = video codec
-ova = audio codec
-of lavf 
-lavcopts = lavc codec options
aglobal=1 same as vglobal for audio headers (default)
vglobal=1 to control writing global video headers (default)
vcodec=mpeg4
vbitrate=1000
threads=4, core2 quad
threads=2, core2 duo
acodec=libfaac for AAC audio.
-af to setup a chain of audio filters. (lavcresample=24000)
-vf scale=480:272,
-lavfopts format=psp
-ofps 30000/1001, framerate.

searching the web and trying different parameters is all i do' you can improve anything you wish' have at it, it works well for me :P

 

lightning fast conversion :tup:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...