# HELP! My computer can't be that slow...

## Salsero

I've been using gentoo for 8 months now, and finally I managed to configure everything, and I think I understand a lot now.

BUT, I AM NOT HAPPY!!!

Applications start too slowly in my opinion. Although I am not dual-booting, I have just Gentoo on my laptop I remember applications startup times on Winblows and it was REALLY faster.

Firefox starts in windows in about 2.5 seconds. 

In Gentoo (and I tried all the Desktops: KDE, Gnome, Fluxbox, XFCE, you name it I tested it) it starts in about 10 seconds.

Kontact starts in 16 seconds.

This is too slow for me.

I am sure it's a config problem, and in order to try and get to the bottom of this (and before I try another distro) I'll save some time by saying:

I tried prelinking and without it - and got no performance benefit.

I tried the recomended -O2 and -O3 CFLAGS and nothing (now it's -O2).

I have DMA enabled (I read a lot about hdparm).

I tried LDFLAGS and it also made no difference.

My hardware:

It's a toshiba laptop:

Celeron 1.8 GHz (Pentium 4 based)

512 MB memory

40 GB hd

Are those startup times normal???

Thanks in advance.

----------

## frostschutz

Can you post output of

```
emerge --info

hdparm -Tt /dev/your_hard_disk
```

----------

## Salsero

Posting the info:

```
emerge --info

Portage 2.0.52-r1 (default-linux/x86/2005.0, gcc-3.3.5, glibc-2.3.5-r1, 2.6.13-ck5 i686)

=================================================================

System uname: 2.6.13-ck5 i686 Mobile Intel(R) Celeron(R) CPU 1.80GHz

Gentoo Base System version 1.12.0_pre8

dev-lang/python:     2.3.5, 2.4.2

sys-apps/sandbox:    1.2.13

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6

sys-devel/binutils:  2.16.1

sys-devel/libtool:   1.5.20

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"

CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks sandbox sfperms strict"

GENTOO_MIRRORS="ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.gentoo.mesh-solutions.com/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://ftp.ankara.edu.tr/gentoo/ ftp://ftp.ankara.edu.tr/gentoo/"

LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="x86 X alsa apm arts avi berkdb bidi bitmap-fonts cdr crypt cups curl dvd dvdread eds emboss encode esd fam foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 hal icc ieee1394 imagemagick imlib ipv6 java jpeg junit kde libg++ libwww mad mikmod mmx motif mozilla mp3 mpeg ncurses nls nvidia ogg oggvorbis opengl oss pam pdflib perl pic png python qt quicktime readline samba sdl slang spell sse sse2 ssl svga tcpd tiff truetype truetype-fonts type1-fonts vcd vorbis wifi win32codecs xine xml2 xmms xv zlib video_cards_nvidia userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LINGUAS
```

```
hdparm -Tt /dev/hda

/dev/hda:

 Timing cached reads:   1196 MB in  2.00 seconds = 597.19 MB/sec

 Timing buffered disk reads:   68 MB in  3.08 seconds =  22.07 MB/sec
```

----------

## i92guboj

No, the startup times are not normal. But less usuall is this:

```

hdparm -Tt /dev/hda 

 

/dev/hda: 

 Timing cached reads:   1196 MB in  2.00 seconds = 597.19 MB/sec 

 Timing buffered disk reads:   68 MB in  3.08 seconds =  22.07 MB/sec

```

Your drive should do around 30mb/sec or more in buffered reads, so, maybe there it is the problem. Can you post "hdparm -cdi /dev/hda" so we can see what setting is that drive using? The problem may be there (though I cant be completelly sure, of course).

----------

## Salsero

This is the info about the settings...

```
/dev/hda:

 IO_support   =  3 (32-bit w/sync)

 using_dma    =  1 (on)

 Model=TOSHIBA MK4018GAP, FwRev=M0.03 A, SerialNo=X2N76865T

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=46

 BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=78140160

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=yes: unknown setting WriteCache=enabled

 Drive conforms to: device does not report version:

 * signifies the current active mode
```

----------

## i92guboj

Definitively, a drive with 32bit async transfers enabled and udma5 capable should be much faster than that. Maybe is a kernel issue. Try different kernels and make sure you have all the relevant options for your chipset. I'm not too experienced with laptops but that number seems so low for your drive. Can't say if that is your only problem though.

For example, when reading/writing intensively to hd, can you notice an high cpu use? If the dma is working properly the cpu should not work that much. What filesystem are you using?

----------

## NeddySeagoon

Salsero,

Please post the output of 

```
hdparm /dev/hda 
```

That shows the settings in use buy the system now, rather than what the capabilities of the drive are.

----------

## i92guboj

The setting in use by the system are above also, relevant things are:

```
/dev/hda: 

  IO_support   =  3 (32-bit w/sync) 

  using_dma    =  1 (on) 

  UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 

  * signifies the current active mode

```

Check the last line, and look the '*' into the previous one: it says *udma5, which means that that mode is in use, and not only a possible capability. The io_support mode in use is 3 (which means 32 bits and asynchronous reads, which are faster than synchronous ones). You can see also the the dma is turned on.

----------

## NeddySeagoon

6thpink,

hdparm lies  

```
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

  * signifies the current active mode 
```

The man page says 

```
       -i     Display the identification info that was obtained from the drive

              at  boot  time,  if  available.  This is a feature of modern IDE

              drives, and may not be supported by  older  devices.   The  data

              returned  may or may not be current, depending on activity since

              booting the system.  However, the current multiple  sector  mode

              count  is  always  shown.  For a more detailed interpretation of

              the identification info, refer to AT  Attachment  Interface  for

              Disk  Drives  (ANSI ASC X3T9.2 working draft, revision 4a, April

              19/93).
```

Its clear that DMA is in use, or the data rate would be under  5Mb/sec. Multi mode may not be on.

Acoustic management (slowing head slewing) could be on, that will decrease the data rate too.

----------

## i92guboj

Thanks for the info. Did not know that, but, how can we be sure that the hdparm (whithout -i switch) is more accurate on that? I think that the procedure to show the io-settings and using-dma shoudl be the same for both infos. And, the mode is not displayed by that report, neither the acoustic management feature status (@Salsero for that use -M). Note although that that feature is not tested, and it is very unlikely that he is using it, because the default are never automatically changed. It is safe to use it to check the value of the param though...

----------

## Salsero

 :Very Happy:  Just wanted to say thanks a lot for trying to help  :Very Happy: 

since I'm not home right now, I'll post the data tomorow...

and than maybe you guys will be able to get to the bottom of this...  :Razz: 

----------

## bollucks

Welcome to linux, where application startup times suck. There is nothing wrong with your configuration - it's an operating system issue. As gcc, glibc and c++ applications improve things will get gradually better, but for the moment: WE SUCK.

----------

## i92guboj

 :Shocked:  *6th picks a gun for a suicide... all is lost*  :Shocked: 

----------

## Salsero

I'm currently using ReiserFS.

Posting the info...

```
hdparm /dev/hda

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 65535/16/63, sectors = 78140160, start = 0
```

----------

## ruben

@Salsero

Could you post your "/etc/hosts" file?

And the output of "/sbin/ifconfig -a" ?

Your machine might be waiting for a network timeout or something.

On my pentium4 1.7Ghz, it definitely does not take 10 seconds to start firefox.

What if you start up firefox, close it and start it up again.... how long before it's started the second time? If it's starts a lot faster the second time, then it would be your harddisk.

You have your whole gentoo on 1 partition? How full is the partition? You update frequently?  Just for reference: on my old iBook G3 800Mhz, starting gnome from GDM to usable desktop took 45 seconds on a fragmented Reiserfs partition, and 25 seconds on a non-fragmented Reiserfs partition (was on a slow 4200rpm drive btw).

----------

## Salsero

 *ruben wrote:*   

> 
> 
> Could you post your "/etc/hosts" file?
> 
> And the output of "/sbin/ifconfig -a" ?
> ...

 

# /etc/hosts:  This file describes a number of hostname-to-address

#              mappings for the TCP/IP subsystem.  It is mostly

#              used at boot time, when no name servers are running.

#              On small systems, this file can be used instead of a

#              "named" name server.  Just add the names, addresses

#              and any aliases to this file...

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $

#

127.0.0.1 localhost Michel localhost.localdomain 

# IPV6 versions of localhost and co

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

------------------------------------------------------------------------------------------------------------------------

/sbin/ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:00:39:CE:BC:9D

          inet addr:10.0.0.141  Bcast:10.0.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS MULTICAST  MTU:1500  Metric:1

          RX packets:8755752 errors:0 dropped:0 overruns:0 frame:0

          TX packets:11835873 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:768172894 (732.5 Mb)  TX bytes:2445534070 (2332.2 Mb)

eth1      Link encap:Ethernet  HWaddr 00:06:25:16:F2:7D

          inet addr:10.0.0.151  Bcast:10.0.0.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:664524 errors:0 dropped:0 overruns:0 frame:0

          TX packets:698810 errors:34 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:413778080 (394.6 Mb)  TX bytes:524000793 (499.7 Mb)

          Interrupt:11 Base address:0xd000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:782 errors:0 dropped:0 overruns:0 frame:0

          TX packets:782 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:39640 (38.7 Kb)  TX bytes:39640 (38.7 Kb)

------------------------------------------------------------------------------------------------------------

If I open Firefox then close it, then it loads the second time in about 3 seconds. But it's because part of the prog is in my memory already...

----------

## Karsten from Berlin

My notebook also isn't faster. It's a Dell Latitude C840, so it's not a cheap one. I think that normal notebooks harddrives are simply to slow (RPMs) compared with modern desktop HDD with 7200RPM.

```
kbecker ~ # hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   1408 MB in  2.00 seconds = 702.70 MB/sec

 Timing buffered disk reads:   74 MB in  3.03 seconds =  24.42 MB/sec

kbecker ~ # hdparm /dev/hda

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 16383/255/63, sectors = 60011642880, start = 0

kbecker ~ # hdparm -i /dev/hda

/dev/hda:

 Model=FUJITSU MHS2060AT, FwRev=8307, SerialNo=NL14T3312VVS

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=117210240

 IORDY=yes, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

 AdvancedPM=yes: mode=0xFE (254) WriteCache=enabled

 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 3a:

 * signifies the current active mode

kbecker ~ # hdparm -I /dev/hda

/dev/hda:

ATA device, with non-removable media

        Model Number:       FUJITSU MHS2060AT

        Serial Number:      NL14T3312VVS

        Firmware Revision:  8307

Standards:

        Used: ATA/ATAPI-6 T13 1410D revision 3a

        Supported: 6 5 4 3

Configuration:

        Logical         max     current

        cylinders       16383   65535

        heads           16      1

        sectors/track   63      63

        --

        CHS current addressable sectors:    4128705

        LBA    user addressable sectors:  117210240

        LBA48  user addressable sectors:  117210240

        device size with M = 1024*1024:       57231 MBytes

        device size with M = 1000*1000:       60011 MBytes (60 GB)

Capabilities:

        LBA, IORDY(cannot be disabled)

        bytes avail on r/w long: 4      Queue depth: 1

        Standby timer values: spec'd by Standard, no device specific minimum

        R/W multiple sector transfer: Max = 16  Current = 16

        Advanced power management level: 254 (0xfe)

        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5

             Cycle time: min=120ns recommended=120ns

        PIO: pio0 pio1 pio2 pio3 pio4

             Cycle time: no flow control=240ns  IORDY flow control=120ns

Commands/features:

        Enabled Supported:

           *    READ BUFFER cmd

           *    WRITE BUFFER cmd

           *    Host Protected Area feature set

           *    Look-ahead

           *    Write cache

           *    Power Management feature set

           *    Security Mode feature set

           *    SMART feature set

           *    FLUSH CACHE EXT command

           *    Mandatory FLUSH CACHE command

           *    Device Configuration Overlay feature set

           *    48-bit Address feature set

                Automatic Acoustic Management feature set

                SET MAX security extension

                SET FEATURES subcommand required to spinup after power up

                Power-Up In Standby feature set

           *    Advanced Power Management feature set

           *    SMART self-test

           *    SMART error logging

Security:

                supported

                enabled

        not     locked

                frozen

        not     expired: security count

        not     supported: enhanced erase

        Security level high

        40min for SECURITY ERASE UNIT.

HW reset results:

        CBLID- above Vih

        Device num = 0 determined by the jumper

Checksum: correct
```

----------

## TommyDrum

[OT]

 *Quote:*   

> 
> 
> Heaven: The police are British, the chefs Italian, the mechanics German, the lovers French and it's organized by the Swiss.
> 
> Hell: The police are German, the chefs British, the mechanics French, the lovers Swiss and it's organized by the Italians.
> ...

 

[/OT]

hehehee....  :Laughing: 

----------

## Salsero

 *Karsten from Berlin wrote:*   

> My notebook also isn't faster. It's a Dell Latitude C840, so it's not a cheap one. I think that normal notebooks harddrives are simply to slow (RPMs) compared with modern desktop HDD with 7200RPM.
> 
> 

 

How about the startup times of your applications? Are they as SLOW as mine:

GIMP, KONTACT, FIREFOX, etc...

I hate having to wait like 15s for anything to open... It makes me want to go back to WINBLOW$... And I don't want that.

----------

## Karsten from Berlin

Yes, it's the same slow(-ly ? )ness. Prelinking didn't help. The only way I found to make things start noticeable (-ly ? ) faster was to use IceWM instead of the whole KDE suite. Our second admin also runs Gentoo, but uses XFCE. He also complained about our notebooks being so slow.

Our only idea are the harddisks. The rest of our hardware should be performant enough. 

BTW, I have a P4-Mobile (2,4Ghz) with 1024Mb, just to get an idea for others who read this threat about the power of my machine.

----------

## jacquesbernardes

Try unmerge blackdown java suit and emerge sun-jdk. For me it makes a lot of difference. Not only for Mozilla-firefox but also to OpenOffice.  

Another thing : for me mozilla start and running times  are much faster then Firefox ones. 

That´s it

Jacques

----------

## Salsero

I actually tried using gnome, kde, fluxbox, xfce - I have them all installed and I tested startup times with all of them, and it didn't make ANY difference...

I simply cannot believe that my computer prforms so badly under gentoo, again, in windows it was a whole lot faster...

Maybe there is some config problem I'm not aware of... I don't know...

I

----------

## ruben

 *Salsero wrote:*   

> 127.0.0.1 localhost Michel localhost.localdomain

 

I'm not a pro regarding this stuff, but on my laptop i have something like this:

(in any case, you should place the entries like: ipadress longname shortname(s)

```
127.0.0.1  localhost

127.0.0.1 michel.localdomain  michel

```

I also commented out the IPv6 addresses since i don't use those. I don't know whether it's gonna make a difference. Is your hostname "Michel" ? Is that the hostname which you placed in /etc/conf.d/hostname? Can you ping localhost?

```
eth0      Link encap:Ethernet  HWaddr 00:00:39:CE:BC:9D

          inet addr:10.0.0.141  Bcast:10.0.0.255  Mask:255.255.255.0

eth1      Link encap:Ethernet  HWaddr 00:06:25:16:F2:7D

          inet addr:10.0.0.151  Bcast:10.0.0.255  Mask:255.255.255.0
```

You use 2 network interfaces at the same time ?

 *Salsero wrote:*   

> If I open Firefox then close it, then it loads the second time in about 3 seconds. But it's because part of the prog is in my memory already...

 

Yeah, i asked that to see whether the harddisk is the bottleneck. I guess it is mainly the harddisk then. Your harddisk might be fragmented. I've noticed that fragmentation can have an effect on a laptop, especially when the harddisk is almost full, and i think gentoo is especially hard on fragmentation if you do frequent "emerge sync"s and frequent updates. You could also monitor cpu usage during the startup of a program. If your cpu is not used for 100% during the second run, then there might be something else.

----------

## Salsero

I placed the files according to what you did (Ruben), and commented the IPv6.

I have a PCMCIA wireless card (eth1) and my builtin ethernet (eth0)

```
ping -c3 localhost

PING localhost (127.0.0.1) 56(84) bytes of data.

64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.071 ms

64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.131 ms

64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.073 ms

--- localhost ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 1999ms

rtt min/avg/max/mdev = 0.071/0.091/0.131/0.029 ms
```

----------

## NeddySeagoon

Salsero,  Karsten from Berlin,

From your hdparm /dev/hda ouput, your IDE kernel settings are correct.

----------

## Salsero

Because I refuse to go back to Winblow$, I have an idea so I need help from you guys - the veterans...

My idea is to use this post: HOWTO: Mount / in RAM and load apps instantly

Now the problem is that I don't have my drive partitioned as the guy that wrote the post says you have to, and to load all my /lib /usr/lib /bin /usr/bin /sbin /usr/sbin directories because it's well over my 512 MB of RAM.

So, I thought about reinstalling Gentoo, and ONLY installing the packages I need, so that I can load all the stuff in my memory.

Now, I need how to partition my hard drive based on that post, and what filesystem to use in each partition - now guys, please remember that the bottleneck of my system is my hard drive not the CPU!

So if a certain filesystem uses more CPU but is faster than another - it will be good for me.

Also, if I rebuid my system, bearing in mind that my hard disk is the bottleneck, then what CFLAGS should I use so the file size is minimal? -Os?

----------

## bollucks

No linux filesystem is as quick as ext2 with noatime and dir_index. Yes you don't get journalling with ext2 but then you've been without journalling on windows forever so you won't miss it, and provided you're not planning dangerous activities with experimental kernels and the like you should be fine. As for CFLAGS, -Os definitely does give you the smallest binaries. Forget the mount / in ram idea as your problem is application startup, and you need to put firefox et al in there, not the system libraries. Furthermore you have to actually read them into / once from the hard drive anyway so it is artificially speeding things up for the second run, not the first.

----------

## Salsero

 *bollucks wrote:*   

> No linux filesystem is as quick as ext2 with noatime and dir_index.

 

noatime is what you specify in fstab right? but what is the dir_index thing?

 *bollucks wrote:*   

> Forget the mount / in ram idea as your problem is application startup, and you need to put firefox et al in there, not the system libraries. Furthermore you have to actually read them into / once from the hard drive anyway so it is artificially speeding things up for the second run, not the first.

 

The guy from the post seems REALLY convinced it works... I don't know, can anyone comment success on the mouting in ram idea?

Another question, would these be good optimizations for small binary size?

```
LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"

CFLAGS="-march=pentium4 -Os -pipe -fomit-frame-pointer"
```

Thanks!   :Very Happy: 

----------

## frostschutz

Mounting stuff in RAM is fine in theory. However, keep in mind that this will most likely require quite a huge amount of RAM, and if other applications require a lot of RAM as well, the Ramdisk part (huge parts of which don't get accessed most of the time) will most likely be dumped to the swap partition, and then you got the old problem back again (access part of the ram disk and it first has to be loaded back from swapdisk into ram before you're able to use it).

I'd first go with other startup-speed optimization enhancements, like prelink and stuff.

----------

## bollucks

 *Salsero wrote:*   

>  *bollucks wrote:*   No linux filesystem is as quick as ext2 with noatime and dir_index. 
> 
> noatime is what you specify in fstab right? but what is the dir_index thing?
> 
>  *bollucks wrote:*   Forget the mount / in ram idea as your problem is application startup, and you need to put firefox et al in there, not the system libraries. Furthermore you have to actually read them into / once from the hard drive anyway so it is artificially speeding things up for the second run, not the first. 
> ...

 

-march=i386 produces the smallest code but you miss out on certain features like nptl. -march=pentium4 actually produces some unstable code (even though noone admits it in practice). -march=i686 (ie the default) is a reasonable compromise and -mtune=pentium4 if you still want that slight immeasurable performance improvement. 

noatime you set as an option in fstab, correct

dir_index is only available on 2.6 kernels and you can set it at any time on ext2/3 and it will start indexing directories in a B-tree from that point on

tune2fs -O dir_index /dev/****

where **** is your partition

I'll leave it up to your judgement what to make of the mount / on ram thing... I've already said what I think.

----------

## ruben

 *Salsero wrote:*   

> So, I thought about reinstalling Gentoo, and ONLY installing the packages I need, so that I can load all the stuff in my memory.

 

If you're reinstalling anyways, what you could try, is to boot from a livecd, mount your root-partition, targzip it and put it on another partition, then reformat your root-partition, and copy the whole system back. That way, you'll have a fragmentation-free system, which will hopefully also be a faster system. At least, it gave a noticeable effect on my laptop (4200rpm slow disk), but that's not a guarantee it'll be the same in your case.

As to the mount-root-in-ram approach... there are important disadvantages. Ideally you only want the files in ram that you need like the binary and the needed libraries of a couple of applications. With that approach, when you run an application, you'll have it once in ram because of the ramdisk, and a second time in ram because you're running it. And i believe there's also the problem of what to do when updating your machine.

Instead of mounting your root in ram, you might try the approach in https://bugs.gentoo.org/show_bug.cgi?id=64724, which does a readahead of for example the firefox files at boot time. Of course this will only speed up the files for which you do a readahead.

----------

## bollucks

Actually there's a simple defragging tool available on the ck website:

http://ck.kolivas.org/apps/defrag/

----------

## guillote_GNU

I'm currently having same problem as Salsero.

When i run apps that require hard work from hard disk e.g. firefox, openoffice, mplayer, or working with k3b (when checks mp3 or md5sums of iso files), they turn the machine too slow... even with low cpu work and low ram usage. So i gues that is a HD config thing... any comments?

----------

## ruben

 *bollucks wrote:*   

> Actually there's a simple defragging tool available on the ck website:
> 
> http://ck.kolivas.org/apps/defrag/

 

Yup.. "simple" is the word. It's really a "poor man's defragmentation tool": it simply copies files around in the filesystem. I can't comment on how good the results are, since i didn't use it.

In his README, he also refers to davtools. A tool to view the fragmentation on ext2/ext3 file systems. I tried it on my portage partition, which is used for ebuilds (which are synched), the cache from ccache, and the compile space for emerge. The fragmentation rate was 21%. That does not surprise me however, since there's a whole lot of activity on that filesystem. That's also the reason i placed those directories on a separate partition, so that the fragmentation they cause does not spread over my entire system.

Btw, if you (Salsero and Guillotte_GNU) happen to be using ext2/ext3, then it can't hurt to use the davtools to see whether fragmentation is an issue.

----------

## Salsero

so, if I understand the advice:

1. mounting on RAM is nice in theory but sucks in practice.

2. the fastest filesystem I can get (stability aside) is ext2 with the noatime option in my fstab and using dir_index.

3. CFLAGS should be (for small binaries): -march=i686 -Os -pipe -fomit-frame-pointer

4. defrag with ck's tool.

Some questions unanswered:

1. what about my LDFLAGS="-Wl,-O1 -Wl,--sort-common -s"? is this good?

2. I know some of you say: "KDE is slow and cosumes a lot of memory" - but for me is the only confortable option - and my problem with slow startup application times happends with gnome and fluxbox as well. SO... What USE options should I put in my make.conf... is this ok?

USE="X qt kde  alsa oss dvd cdr samba hal bidi icc ieee1394 spell dvdread java  mmx wifi sse sse2 vcd avi win32codecs nvidia mozilla -gtk -gnome -gtk2 -motif"

Thanks!Last edited by Salsero on Thu Oct 13, 2005 11:09 am; edited 1 time in total

----------

## bollucks

 *Salsero wrote:*   

> 4. defrag with ck's tool.
> 
> 

 

defrag only if there's significant fragmentation measurable. Oh and always keep your partitions less than 75% full as their performance drops off dramatically at that point.  If you find yourself with lots of partitions and high percentage usage on some you should consolidate them. Most -normal- desktops should never need more than 3.

Can't comment on that other stuff.

----------

## ruben

One remark about ext2. It is indeed the fastest, but every x mounts, it will check the whole filesystem at boot and this can take a long time. Just so you know.

About the CFLAGS, i've been using "-march=pentium4 -mcpu=pentium4 -O2 -pipe -fomit-frame-pointer" for over a year and i have not noticed anything unstable whatsoever, contrary to what bollucks seems to claim.

----------

