You are not logged in.

#1 2006-10-25 10:50:32

Cimi
Member
From: Padova, Italy
Registered: 2006-01-16
Posts: 301
Website

[PERFORMANCE] Precompiled vs Compiled

Hi all I was thinking about using precompiled arch kernels instead compiling my own (which I do since 5 years...), someone of you knows if there's a difference in performance between precompiled archlinux kernel and my custom compiled ones? smile

I think that precompiled kernels are built with CFLAGS of makepkg.conf, despite compiled ones that use no CFLAGS but surely *something* is optimized by the PROCESSOR string in .config (in my case it is amd k7 which is better than i686). So surely there's a difference but which one is better?
Also precompiled kernels features a different "way" to the kernel bootup since it uses initrd and it launch different modules that may slowdown performances.  :?:

Since for me it's not a problem compile the kernel by myself I was asking here an opinion from an expert.


Murrine Creator - GNOME Developer

Offline

#2 2006-10-25 11:21:06

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: [PERFORMANCE] Precompiled vs Compiled

I doubt there is some big difference in performance between kernels installed from package and compiled by hand / with ABS.
IMHO there's no need to bother with custom kernels for most setups.


to live is to die

Offline

#3 2006-10-25 14:51:15

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [PERFORMANCE] Precompiled vs Compiled

If you drop ramdisk and compile in your pata/sata driver, fs driver and the other nesesary stuff, you can reduce the boot time quite a bit, but that's about the only realy noticable gain you wil have. (exept for the placebo effect of haveing a custom kernel ofcause:))


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2006-10-25 15:15:49

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: [PERFORMANCE] Precompiled vs Compiled

Its all a matter of personal preference. I personally have never seen enough of a gain from compiling my kernel to offset the time it takes to compile. Have you experimented with some of the other kernels available -- some people claim noticeable speed improvements with -mm, and a lot of archers really like -beyond.

Dusty

Offline

#5 2006-10-25 15:57:48

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: [PERFORMANCE] Precompiled vs Compiled

i don't think compiling a kernel would make things faster. the only benefit i can see in compiling a kernel is additional features that are not in stock kernels.


what goes up must come down

Offline

#6 2006-10-25 17:10:58

Cimi
Member
From: Padova, Italy
Registered: 2006-01-16
Posts: 301
Website

Re: [PERFORMANCE] Precompiled vs Compiled

These are only "impressions", I had that impression too... but I was searching a good argument to this


Murrine Creator - GNOME Developer

Offline

#7 2006-10-25 17:50:48

brazzmonkey
Member
From: between keyboard and chair
Registered: 2006-03-16
Posts: 818

Re: [PERFORMANCE] Precompiled vs Compiled

some features may improve performance in some cases. little performance enhancement requires long configuration and compilation. so it isn't worth imho, except for some features you may be in need of.


what goes up must come down

Offline

#8 2006-10-25 18:28:22

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: [PERFORMANCE] Precompiled vs Compiled

Ages ago (back in my Gentoo days), I experimented with various programs and various CFLAGS, and after a month of tweaking CFLAGS and recompiling, I drew this conclusion:  It made bugger all difference what it was optimised for.  The only thing I found that mattered was the -O setting.  And enabling SSE3 had a few benefits (of the millisecond scale).

In terms of the kernel, the difference will be piddly.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#9 2006-11-06 16:19:36

B15HOP
Member
From: Australia
Registered: 2005-02-10
Posts: 138

Re: [PERFORMANCE] Precompiled vs Compiled

I think having a smaller kernel does help boot time substantially. I do believe it helps a little. I pretty much have no choice anyway because ATi drivers will not work unless I compile my own kernel. So in some way yes I do get a speed improvement by compiling my own kernel.


"The ecological crisis is a moral issue."

Offline

#10 2006-11-06 16:32:13

filoktetes
Member
From: Skien, Norway
Registered: 2003-12-29
Posts: 287

Re: [PERFORMANCE] Precompiled vs Compiled

On my computer,the Asus W5A, the precompiled kernel uses a very long time to boot, and some X programs (e.g aterm) gets extremely slow (I have to wait for key presses). This is probably not because the kernel is pre-compiled, but because something isn't configured correctly for my system. Compiling a kernel with only what I actually need (compiled in, no modules), makes everything work, and about halves the boot time.

Offline

#11 2006-11-09 16:15:07

superstoned
Member
Registered: 2006-09-04
Posts: 268

Re: [PERFORMANCE] Precompiled vs Compiled

brazzmonkey wrote:

some features may improve performance in some cases. little performance enhancement requires long configuration and compilation. so it isn't worth imho, except for some features you may be in need of.

and don't forget that often you de-optimize stuff, and you'll find out about that only much later ;-)
also, the ppl building your precompiled kernel often know more than you do, and they optimize things better than you might, even tough they can't optimize for your specific architecture.

ok, granted, faster startup can be accomplished, but the kernel isn't that slow in starting up, it's mostly the services you'd have to wait for, i guess...

so unless you want certain features, i wouldn't do it.


-=] life sucks deeply [=-

Offline

#12 2006-11-09 22:10:38

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: [PERFORMANCE] Precompiled vs Compiled

In recent times, with highly modular kernels and with the great improvements of mkinitcpio over mkinitrd, the reasons to compile a kernel are lessening.

However, I continue to compile my own kernel, and not only since it is one of the most instructive experiences out there (if you take the time to study the kernel docs). There are also specific features I need in my different machines. E.g., in the laptop I am using now, two features come to mind: 1) since I have exactly 1G of ram, I prefer not to enable HIGHMEM, enabling lowmem support for full 1G of memory; 2) on this intel 1915 video card, the specific hardware framebuffer driver intelfb is noticeably faster than vesafb or vesafb-tng; this happens also in my machines with a radeon card (radeonfb is faster than vesafb).


Mortuus in anima, curam gero cutis

Offline

#13 2006-11-09 22:32:44

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: [PERFORMANCE] Precompiled vs Compiled

Kernels dont follow the CFLAG string. Many of the 'optimisations' there will break a kernel.

Kernels utilise only what they know are safe, and these are, excepting one or two, auotmatically determined by the build process and configuration.

patroclo7: we've looked at including framebuffer drivers, however some of these are known to cause problems. In an older beyond I turned on radeondb, which broke fglrx for many. nvidiafb doesnt work with the nvidia driver either. We've discussed workarounds, but it hasnt been a pressing issue, although I suppose we could enable some that are known good.

James

Offline

#14 2006-11-10 00:26:42

B15HOP
Member
From: Australia
Registered: 2005-02-10
Posts: 138

Re: [PERFORMANCE] Precompiled vs Compiled

Yes but doesn't the make menuconfig have options to compile for size and when you select architecture, it must compile some parts with -march=(my cpu type). Otherwise why would they go to the trouble of asking in the first place?

I always disable Frame Buffer devices but that means I only get to use the fglrx drivers for my x1600. They are still buggy, but a hell of a lot faster than the vesa drivers. The radeonfb and open source drivers have never worked for me anyway. Only because the x1600 is new.

Back when I used a nvidia card, I enabled nvidiafb which improved speed substantially. I also used the nvidia driver of which required me to compile my own kernel also.

Phillip.


"The ecological crisis is a moral issue."

Offline

#15 2006-11-10 13:21:19

vredfreak
Member
Registered: 2004-11-20
Posts: 66

Re: [PERFORMANCE] Precompiled vs Compiled

You could always run from each for awhile, have both a stock and self-compiled kernel.  Run one for a few days then run the other and see if notice any real differences.


Hi.  I'm a sig.  What are you?

Offline

#16 2006-11-11 07:51:34

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: [PERFORMANCE] Precompiled vs Compiled

B15HOP wrote:

Yes but doesn't the make menuconfig have options to compile for size and when you select architecture, it must compile some parts with -march=(my cpu type). Otherwise why would they go to the trouble of asking in the first place?

As a rule, compile for size, and as of 2.6.18 enable regparm.

That and selecting your processor are about as far as you can go with optimisations - the kernel is very sensitive. Even in selecting the processor, selecting anything more specific than 686 won't make much of a difference.

At one stage there was a patch floating around in an older ricer patchset to let you compile with your own cflags, I gave it a try and as expected, the resultant kernel didnt boot -- and that was with conservative CFLAGS. If you could find it, it'd probably still apply with a little bit of help - but you'd be wasting your time, there's a reason it was never merged.

James

Offline

#17 2006-11-17 14:37:15

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: [PERFORMANCE] Precompiled vs Compiled

depends what do you want. I compiled custom from vanilla and got 7sec shorter  boot time (bootchart test), and less memory used. Custom kernel allow to select extra patches e.g. grsec or RSBAC to harden kernel of some extra performance patches not available in -mm or beyond (if you want to test them).
Arch seems pretty much optimized so eventual speed gains are negligible but you may add other stuff (not related to speed) not available in Arch kernels.

Offline

#18 2006-11-17 16:43:14

superstoned
Member
Registered: 2006-09-04
Posts: 268

Re: [PERFORMANCE] Precompiled vs Compiled

broch wrote:

depends what do you want. I compiled custom from vanilla and got 7sec shorter  boot time (bootchart test), and less memory used. Custom kernel allow to select extra patches e.g. grsec or RSBAC to harden kernel of some extra performance patches not available in -mm or beyond (if you want to test them).
Arch seems pretty much optimized so eventual speed gains are negligible but you may add other stuff (not related to speed) not available in Arch kernels.

of course, nobody is saying building your own kernel is useless. but they say it's only very usefull for a few,  only moderately usefull for others. and not usefull at all for most.

for speed, the difference is only worth the trouble for those who are already knowledgable enough to do it in a breeze. and for those willing to spend a lot of efforts in saving 2 mb ram and 7 seconds startup speed. but for most, probably even the topic starter, as he seems concerned if its worth his time, it's not very usefull.

if you need the features, on the other hand, things are different. if you really want a certain feature, compiling is the way to go. but i think you must be desperate (eg hardware not working?) to spend a lot of time learning to compile a kernel, while waiting one of 2 releases would almost sure give you those same features...


-=] life sucks deeply [=-

Offline

#19 2006-11-27 14:59:53

shbang
Member
Registered: 2005-10-03
Posts: 76

Re: [PERFORMANCE] Precompiled vs Compiled

I like stock kernel until I run into a situation like I currently have

all the stock kernels I have tried are built with gcc 4.1.1

the version of gcc in current is 4.1.2

I can't build modules for vmware-workstation unless I compile my own kernel with gcc 4.1.2 or wait for a new stock kernel built with gcc 4.1.2

Offline

#20 2006-11-27 16:18:15

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: [PERFORMANCE] Precompiled vs Compiled

shbang wrote:

I can't build modules for vmware-workstation unless I compile my own kernel with gcc 4.1.2 or wait for a new stock kernel built with gcc 4.1.2

Of course you can build them. Simply give another answer instead of default when vmware-config.pl asks. They compile very nicely and even work. wink


to live is to die

Offline

#21 2006-11-27 18:20:29

shbang
Member
Registered: 2005-10-03
Posts: 76

Re: [PERFORMANCE] Precompiled vs Compiled

that's exactly what I did and my vm just crashes (as vmware-config indicated it might)

Offline

#22 2006-11-28 11:10:27

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: [PERFORMANCE] Precompiled vs Compiled

shbang wrote:

that's exactly what I did and my vm just crashes (as vmware-config indicated it might)

So it's your virtual machine crashes? Not vmware-workstation?
It's a known bug, but I've got it only once. You may try to add noapic option when your virtuul machine crashes every time.


to live is to die

Offline

#23 2006-11-28 15:26:50

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: [PERFORMANCE] Precompiled vs Compiled

Hmm... some reason people think that modular kernels initialize the hardware slower. As that may be true since there is some more I/O transactions involved, a few miliseconds may be added when loading a module; it's not such a big deal since initializing the hardware - the process itself - does take just ask long.

A real killer for bootup-time is udev which scans /sys for devices. This, you can't really change unless you switch to a static dev, which in fact makes a lot of sense on machine that do not have any hotplugable interfaces. Such as pre-usb boards for some pentium pro and as I experience it on Motorola PowerStack machines.

What I find strange though is that it takes udev differently long on different machines. I know, it might be related to the number of potential devices detected to load modules for many of you will say, but that doesn't seam to be a good unit to measure. You see, my P4 2.8ghz at work takes about 8 seconds to get past uevents, while the pentium m 1.1ghz based machine next to it - with the same number of and similar types/vendors of devices - rushes past it in 2 seconds.  :?: I think what you really should optimize is your hardware to gain some speedups.

Fiddling with the inner workings of things to get it right, makes you lose more time than you'll ever gain again until you need to rebuild your bootstrap-system sinc eyou didn't document it. That would have taken you another day plus you didn't of making a standardized package, didn't you? wink

In essence, why do people reboot their computers that often? For me it's a blessing to have the chance to make an excuse to get my first coffee in the morning before reading my email.  lol

Just my opinion on things.


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#24 2006-11-29 20:29:55

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: [PERFORMANCE] Precompiled vs Compiled

Romashka wrote:
shbang wrote:

that's exactly what I did and my vm just crashes (as vmware-config indicated it might)

So it's your virtual machine crashes? Not vmware-workstation?
It's a known bug, but I've got it only once. You may try to add noapic option when your virtuul machine crashes every time.

If it's vmware-config.pl that crashed, give it this answer when it asks for kernel headers :
/usr/src/linux-2.6.18-ARCH/include

The headers include a file ( Module.symvers ? ) that allows vmware to build against a kernel compiled with a different gcc version.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#25 2006-12-24 09:26:37

fk
Member
From: Germany
Registered: 2006-04-29
Posts: 524

Re: [PERFORMANCE] Precompiled vs Compiled

joker wrote:

and how about modules from pacman like nvidia drivers? is it possible to use it on compiled kernels?

If you wont use these with your own custom Kernel, you must recompile the modul.


Have you tried to turn it off and on again?

Offline

Board footer

Powered by FluxBB