Ivor O’Connor

October 25, 2009

Speeding Up Ubuntu

Filed under: Uncategorized — ioconnor @ 3:25 pm

I’m getting tired of Synaptic taking a minute or more to add a new package. I complained briefly on the Ubuntu IRC channel about this but nobody was interested. It seems like whoever programmed the application to check dependencies must have used a O(N2) algorithm. In other words the first few applications you add are done quickly. For example if this is the 2nd addition it might take only 2*2 seconds*.1 or .4 seconds. If you add 100 packages then it takes 100*100*.1 or 1000 seconds. That a bit of an exageration. It’s only taking about two minutes to have it check dependencies. Still this should be a split second task.

Anyways things are so poorly coded on Ubuntu, though better than M$, that I don’t trust things. So my next question was how fast are the CPUs running? Well a

cat /proc/cpuinfo

showed me the CPUs were running at about 1/3 speed. Look for the lines starting with cpu MHz:. Apparently the CPUs are suppose to react and increase their CPU speed if needed. I don’t trust anything, given how badly everything else is coded, so I did the following:

sudo cpufreq-selector -c 0 -g performance

sudo cpufreq-selector -c 1 -g performance

Now both CPUs are running at the max speed all of the time. Whether needed or not.

It’s probably possible to put these commands as the default in /etc/rc.local but I don’t know how. Instead edit the file /etc/default/cpufrequtils and add the following lines:

ENABLED=”true”

GOVERNOR=”performance”

MAX_SPEED=”0″

MIN_SPEED=”0″

Now the CPUs will be running at maximum speed across reboots. I’ve tried this and it does work.

It’s amazing people pay lots of money for fast computers yet the developers cut your performance by two thirds and don’t even tell you.

UPDATE 2009.10.26: Seems as if it was not that easy. Apparently it will reset itself to lower speeds if it gets hot. Or confused. Or the defective circuitry DELL stuffs inside batteries and battery charges is not working correctly as in my case. To get around this I’ve had to edit the file sudo gvim /usr/sbin/laptop_mode and make some obvious changes. I’ll see if this does work over the period of a few days. So far so good.

UPDATE 2009.10.28: When booted from battery the CPU speed lowers itself despite the above settings. So for now I’ve manually put the commands into the bashrc script. Since I always work from a shell this works for me. Maybe someday I’ll figure out a better solution.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: