GCC compiles a lot slower than it should

Hello everyone, i'm having a problem compiling an application i'm developing.
For a month, while developing, i did lots of compilations to test it. While compiling, i noticed gcc did it pretty slow, but gave it no importance.
I'm using ubuntu 10.04 32bits, and my pc has:

  • Dual core intel 2.66ghz processor.
  • 4GB ram DDR2 800mhz.
  • 320GB disk, 7200 RPM.
    However, a week ago, i tried compiling the same application in a notebook, running fedora 11 32bits, with the following hardware:
  • Dual core intel 1.66ghz processor.
  • 2GB ram DDR2 667mhz.

When i compiled the application, i noticed gcc did WAY faster. So i started comparing, and saw my ubuntu did a clean compile in 56 seconds, while fedora did it in 10. After seeing this, i began testing the compilation with only 1 source file. I noticed that, while fedora did it slow the first time(1.8 seconds), the rest of the times it did it in 0.192, this is due to disk cache probably. Now in ubuntu, compilation takes always 1.8 seconds. So i'm starting to think it's caused by some cache malfunction. However, i've tested the disk with hdparm, and got a much better throughput in ubuntu(as it should be). Also, ubuntu works well, i can't notice this problem except for gcc.

The application uses Qt4, in ubuntu i'm using version 4.6.2, while on fedora it's 4.6.3. Ubuntu'sw gcc is version 4.4.3, and fedora's is 4.4.1. I noticed while using strace, that 4.4.3 does 2 vforks, while 4.4.1 does only 1, so i guess there was an important change in those versions, but i can't seem to find a reason why a PC should do it 10 times slower than a slower one.

I'm appreciating any help, since i really want to fix this(possibly not reinstalling my whole O.S.).

Thanks!

Can you bring gcc on Fedora up to 4.4.3 and compare the results?