# Optimizations for a laptop

## garrontmo

I am running gentoo on a laptop. Its a decent laptop with a 1 gig p3 processor. I have notice that my biggest hangup seems to be with my hard drive performance. What would be my best flags to get good performance and also keep the size of the compiled binaries down?

Thanks,

Garron

----------

## rac

 *garrontmo wrote:*   

> I have notice that my biggest hangup seems to be with my hard drive performance.

 

Then before you start playing with compiler flags, have you checked out hdparm?

----------

## garrontmo

Yeah, I have messed with hdparm. My settings are for dma 100. From all the stuff I read, there didnt seem like anything I could do to improve my hd performance.

----------

## garrontmo

When I do hdparm -Tt /dev/hda, I get about 197 and 21. When I open up a program like galeon or evolution, The processor usage doesnt go up very high, but my hard drive light is blinking like crazy.

Garron

----------

## tomminator

AFAIK, -O0 optimizes for binary size.

you might also want to strip the debug symbols (not from the libs though).

----------

## rac

GCC3 to Hardware & Laptops, because not too many have gone there.

----------

## phong

Just a general note on HD performance in laptops - Laptop manufacturers actually seek out the lowest power consumption and lowest heat hard drives they can find for Laptops.  These are invariable also the slowest.  Even high-end laptops have dog slow hard drives (all the ones I've ever seen anyway).

Also, to optimize for size you want to use -Os, which may actually help if HD speed is the problem.  The performance of -Os binaries, seems to be close to -O2, which is only a shade slower than -O3, and on a system with a very slow HD, it could be the way to go.  -O0 is almost no optimization, which results in very readable assembly code, but not particularly small binaries.

edit:  How much RAM does the system have?  Obviously, swapping on a slow HD is going to be a much bigger problem than on a fast one, so the amount of RAM could make a huge difference sometimes.

----------

## masseya

You could also check out this thread and see if there's any helpful tidbits there.

----------

