Tip: CPU Scaling Performance October 20th, 2009

CPU ScalingThere is a GNOME Applet included by default in Ubuntu that allows you to adjust your CPU scaling frequency, which most hardware supports. You can right click any panel and select Add to Panel, then select the CPU Frequency Scaling Monitor applet.

This is a misleading name because it does more than just monitor the scaling, it allows you to change it easily. Most people disregard these settings because many settings like this don’t make a huge difference in other applications. There is one place it makes a big difference, which is the mother of all CPU users: Web Flash-based video. This thing basically physically abuses your processor. You can use flash little performance tests to get an idea of how CPU scaling affects your hardware.

In the same way, I find that actually making use of the Powersave and other options when on battery. On desktop systems where power consumption isn’t an issue, this setting will always be set at Performance. While Ondemand is rather good for typical use, some users find that it degrades response-time for things like Compiz.

Also remember that IOWait is typically the bottleneck for a lot of applications. I chose to use Flash as an example because it does a poor job of accomplishing it’s job and as a result requires a magnitude of additional computational power. You can easily compare the amount of processor usage to anything like VLC, Totem, or Mplayer and they will be a fraction of the usage.

Tip: Force your GNOME panel to reload August 11th, 2009

If you’ve installed a GNOME Applet, but you can’t see it in the Add menu, then you’ll either have to reload gnome-panel or wait a while. Reloading isn’t the cleanest thing, but you can do it by executingkillall gnome-panel and then gnome-panel via ALT+F2.

Doing this in a normal terminal isn’t advised, because if that shell is terminated it would also end the panel process. However, if you can get around that by using nohup gnome-panel, or using the bash keyword disown after having ran the process in that terminal.

Tip: Append to an array with + operator August 8th, 2009

You can use the addition and increment operators in PHP to concatenate arrays. For example, $c = $a + $b;

If you’ve used array_merge() to do this in the past, it’s important to note the difference between merging arrays and concatenating them. When you merge they keys are used to determine how the resulting array is formed. When you concatenate the values are added together.

Tip: Don’t close your PHP tags August 8th, 2009

Adding a closing ?> to your <?php tags is actually optional, and you should avoid using it for scripts that will only be included.

Read the rest of this entry »