Does compiling a downloaded linux kernel (e.g 3.2) make the OS (e.g ubuntu) faster on that specific machine?
In general , no.
There are, however, some exceptions to "no". For example the liquorix kernel or Ubuntu kernel Flavors. These are generally performance tuning and can make a difference (the server kernel is faster for servers, and will not improve desktop performance).
With Ubuntu, if you are running the proper kernel flavor, you should be good to go.
Note: The Liquorix kernel also has some patches (in addition to performance tuning).
The other exception would be if you have some unusual hardware.
But in the vast majority of cases, performance is not a "standard" reason to compile a kernel.
The most accurate answer is, as bodhi.zazen said, not usually but with a few exceptions. Most of those exceptions are hardware related, but some are just configuration issues. Justification for my answer follows.
I've compiled twenty-six kernels between two machines in the last month attempting to performance tweak. What I found:
- Changing cpu type in .config to the native architecture and removing options that support other architectures improved file I/O throughput by more than 10% in benchmarks (enough I can "feel the improvement") and reduced delay following user input in XFCE on Xubuntu 12.04 -32bit on my 1.8GHz (K8) Mobile Sempron 512MB RAM laptop. The same changes had no quantifiable or perceivable impact on my 1.73GHz Core2 Duo 2GB RAM laptop in Ubuntu 12.04 64-bit, but did cause one formerly stable application to become crash prone.
- Changing HZ in .config to 1000 dramatically improved responsiveness to user input when under high CPU load in both systems. It also made window focus changes in X instantaneous in all conditions.
- The BFS patch increased battery life in both systems by a few minutes. Just enough to be measurable and consist, but not enough to matter much. Benchmarks revealed no statistically significant performance changes, but both systems "feel" faster. I suspect this has to do with scheduling priority being more beneficial to the typical workloads on those specific machines.
- All other .config combinations tried resulted in decreased performance on both systems.
I spent ridiculous sums of time compiling and testing different configurations. For all that, only five kernels produced a desireable result, out of twenty-six attempted. Seven kernels were not even operable (either unbootable or failed to start X). I recently installed the Liquorix kernel from repository and netted all the above improvements plus a roughly 50% frame rate increase in both the Windows games I play through WINE on the Core2 system. That only took a few minutes, and nothing broke.
Is my OS better because I compiled my own kernel? Well, yeah a little. Until I find something that runs slower/breaks, because I failed to find it during testing. Is my OS faster? No.
In my experience yes. But the benefits mainly come from eliminating unnecessary features, and selecting a few others, such as your processor type. Also, make it a ultra low latency for desktop use. I've been compiling the kernel for years and for me the difference is always noticeable. But there are other benefits. Boot times are also improved.
However, it's very time consuming to get to select only the options you need.
I don't know how about kernel, but in general compiling apps from source usually makes them work faster (I usually do it with dev libs like CGAL, or apps like ParaView). Of course when compiling process is optimized for the architecture and so on.
However I don't think that compiling a kernel would make it faster that much that it had a visible influence on the performance. In my opinion it would only be visible in performance counters.
I compiled a kernel for an EeePC 900A just to remove unnecessary drivers and features, to boot without extra initrd, to set the default I/O scheduler, to optimize for Atom, and to disable debugging and some performance- and responsiveness-degrading power-saving features. (it's being used as server for various little things). Less boot time needed^^ About one year ago I tried it before, but Chromium only showed blank Web pages - with clickable links...