1

I am looking to something that can speed my old laptop from college times a bit. I have heard I can recompile the kernel to get a slight increase in performance in general. But in that laptop there is still a student license for an (now I guess somewhat outdated) Intel compiler.

I am not sure of the reasons but that Intel compiler makes executables noticeable faster than the GNU version (maybe they use secret extensions in the intel CPUs?). I wonder if, compiling the kernel with that proprietary compiler would result in a more noticeable speed performance.

Also, what are other critical parts of the system I can compile by myself to achieve a better performance in general?

2
  • You can't compile the kernel in anything other than GCC without heavy patching.
    – muru
    Feb 7, 2018 at 7:59
  • 2
    Recompiling the kernel on the local machine (but with gcc, as the others explained`, will probably result in a small performance increase, as it can be optimized for your exact cpu type, but you won't notice without a stop watch. It you want to make your system faster, first find out the bottleneck. To my experience, more RAM and replacing the hdd by an ssd helps the most, because the cpu is not the bottleneck.
    – Philippos
    Feb 7, 2018 at 8:32

1 Answer 1

4

I can't speak for the Linux kernel developers (there is additionally no indication that it's the Linux kernel you are talking about, but I'm assuming it is), but on OpenBSD (which I'm more familiar with), even moving to a new version of the same compiler is not something you'd like to do "just like that".

The kernel is an intricate piece of software and in developing it and testing it with a specific toolchain is important for ensuring correct operation.

New versions of the compiler have changes (or it would not be a new version), and these changes may introduce subtle differences in the compiled code. The developers need to make sure that the differences introduced does not cause malfunctions of the most central piece of software in the system (the kernel).

Also, the kernel source code is not standard compliant C code, and the Linux kernel uses (or at least used to use) extensions only present in the GCC toolchain. I read that there was at least initial problems with trying to compile it with clang (now the default compiler on many OpenBSD system). Moving to icc would potentially be an ever bigger step.

On OpenBSD, users are even discouraged from compiling their own custom kernels, which includes changing even single compiler flags from the default, as debugging failures is made so much harder when components have been added to or removed from the generic kernel that has the support of the developers.

In short, I would recommend not trying to compile the Linux kernel with icc.


If there is a particular application that runs slow for you, you may obviously try to recompile it with icc to see if that speeds it up. My experience of compiling open source code with icc is that some applications seems to have been written specifically for the open source compiler toolchains (since that is what the developers use) and fails to compile cleanly with the Intel compilers.

Other suggestions include upgrading the hard drive to a faster one and/or adding more RAM to the system. These kind of improvements are likely to give you a more general performance boost than recompiling with a "better" compiler, especially if the applications that you use are I/O bound (which would benefit from an upgraded hard drive).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .