Before doing anythng, get your graphics drivers up date and make sure hardware acceleration is working properly in Ubuntu.
To get Blender running the fastest on Ubuntu, I build it myself from svn. There are instructions on Blender.org that tell you how to build using 2 different systems. I use scons because it is included as a part of Blender’s source code and it’s super easy to automate. You can find instructions here: http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Linux
Before compiling, you will need to make your own user-config.py file as mentioned in the above tutorial. Here is my user-config.py contents, as an example:
BF_BUILDDIR = r'../buildOpt'
BF_INSTALLDIR = r'../installOpt'
WITH_BF_OPENAL = True
WITH_BF_QUICKTIME = False
WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False # set this to True whenever the player has been ported properly
WITH_BF_JACK = True
WITH_BF_SDL = True
WITH_BF_ICONV = False # has something to do with Collada says jeff
WITH_BF_COLLADA = False
WITH_BF_OPENEXR = True
WITH_BF_FFTW3 = True
WITH_BUILDINFO = True
WITH_BF_RAYOPTIMIZATION = True
WITH_OPENMP = True
WITH_BF_TIFF = True
BF_NUMJOBS = 2
REL_CFLAGS = ['-O3','-fomit-frame-pointer','-funroll-loops','-ffast-math' ]
REL_CCFLAGS = ['-O3','-fomit-frame-pointer','-funroll-loops','-ffast-math' ]
CCFLAGS = ['-pipe','-march=nocona','-ftracer','-ffast-math','-msse','-msse2','-msse3','-mmmx','-funroll-loops','-fforce-addr','-fomit-frame-pointer','-funsigned-char','-fno-strict-aliasing' ]
CXXFLAGS = ['-pipe','-march=nocona','-ftracer','-ffast-math','-msse','-msse2','-msse3','-mmmx','-funroll-loops','-fforce-addr','-fomit-frame-pointer','-funsigned-char','-fno-strict-aliasing' ]
You will need to research GCC optimisation switches in order to get the best results for your CPU. The knowledge you learn here will allow you to build many applications yourself and to see a performance boost in the applications you’ve optimized. I must admit that I have only gone through the trouble of doing this with Blender though!
You can also try the builds on Graphicall.org. Look for a build in the right column that is optimized for your CPU.