Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
System speed questions
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Jocco
n00b
n00b


Joined: 03 Jul 2002
Posts: 24

PostPosted: Tue Jul 09, 2002 1:23 am    Post subject: System speed questions Reply with quote

First, I'm not ripping on Gentoo in any way. This has to be by far my favorite distro yet.

I've read how linux can be much fast than windows in many respects. My gentoo system seems to be slower than my WinXP system. Of course its all in the "user preference" But I would very much like to know the best compile options for my hardware / system.


I'm running...
AMD Athlon 1.2 ghz CPU
1gig SDRAM
Abit Motherboard
Geforce 2 GTS Pro
2 fourty gig 7200 rpm drives
Sony Cdrom
Mitsumi CDRW
ABIT K7TE Motherboard

X is really choppy especially when I'm compiling anything in the background. Another example, as I play and MP3, forget to pause xmms before running emerge, the MP3 starts to skip inevitably freezing linux. Could it be the nvdia driver installed while installing the stage3 tarball at gentoo installation needs to be updated?

Also, which kernel would be the best, as far as stability and speed, the gentoo sources or the linux sources?

What I would love to do, is install GCC 3.1, using the proper compile flags, and re-compile my entire system *grin* but not finding much of any information on how to properly upgrade from version 2.95.

One more question...has anyone been able to tell a noticable difference between Pentium and AMD gentooo systems? In so far as system speed and over all handling?

And last but not least, with a gig of SDRAM, what would be the optimum swap file to set up? Double the RAM would bring that too a 2 gig swap file, would that be applicable?

Thanks in advance.
J.
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Tue Jul 09, 2002 1:26 am    Post subject: Reply with quote

First thought -- make sure dma is enabled on your hard drive. Install hdparm if it isn't already and man hdparm for more information about how to determine if dma is enabled.

Second thought -- there are quite a few posts regarding optimizing for Athlons in the archives. You should start by searching there.

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
kcsduke
n00b
n00b


Joined: 25 May 2002
Posts: 40
Location: Cambridge, MA

PostPosted: Tue Jul 09, 2002 2:09 am    Post subject: Re: System speed questions Reply with quote

Jocco wrote:

Also, which kernel would be the best, as far as stability and speed, the gentoo sources or the linux sources?

I use the gentoo sources. It has some nice patches like grsecurity, low-latency, and premption. The low-latency and preemptive patches help provide better/snappier performance.
Jocco wrote:

What I would love to do, is install GCC 3.1, using the proper compile flags, and re-compile my entire system *grin* but not finding much of any information on how to properly upgrade from version 2.95.

I'm considering the same thing. Look here: https://forums.gentoo.org/viewtopic.php?t=6803&highlight=

Jocco wrote:

And last but not least, with a gig of SDRAM, what would be the optimum swap file to set up? Double the RAM would bring that too a 2 gig swap file, would that be applicable?

Quite honestly, unless you're are running really memory intensive programs, you would probably be fine without a swap at all. I have 256MB RAM and almost never use any of my swap. That said, if you have a lot of hard drive space, you may want to add a swap just in case. Search for this -- I think it's been discussed before. In any case, you definately don't need a 2 gig swap. I think the swap=2*ram is sort of an outdated recommendation given how loaded with memory most new computers are.
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Tue Jul 09, 2002 2:21 am    Post subject: Re: System speed questions Reply with quote

kcsduke wrote:
Jocco wrote:

And last but not least, with a gig of SDRAM, what would be the optimum swap file to set up? Double the RAM would bring that too a 2 gig swap file, would that be applicable?

Quite honestly, unless you're are running really memory intensive programs, you would probably be fine without a swap at all. I have 256MB RAM and almost never use any of my swap. That said, if you have a lot of hard drive space, you may want to add a swap just in case. Search for this -- I think it's been discussed before. In any case, you definately don't need a 2 gig swap. I think the swap=2*ram is sort of an outdated recommendation given how loaded with memory most new computers are.


I have a GB of RAM. When running KDE, Mozilla with eighteen tabs, XMMS, gaim, VMware (eats 256), and a handful of other apps I begin to swap lightly. The max I've seen on the swap was about 50 MB, and that was when I was being crazy. Though, since you might do some crazy things, 256-512 MB of swap ought to be plenty. Since you have 80 GB of storage, 512 MB would be overkill but a bit more safe than no swap at all.
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
burzmali
Apprentice
Apprentice


Joined: 18 Apr 2002
Posts: 238
Location: ca

PostPosted: Tue Jul 09, 2002 3:20 am    Post subject: Reply with quote

what kernel are you using now? i have no mp3 stutter during emerge or heavy disk usage at all. i am using gentoo-sources, i have found them to be very, very good. when i switched to gcc-3.1, i just wiped out my drive and started over from bootstrap. i figured i would probably end up doing that anyway if i tried to upgrade from 2.95. um, i guess that's all i have to offer. good luck.
_________________
burzmali
www.burzmali.net
Back to top
View user's profile Send private message
Spark
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jun 2002
Posts: 87

PostPosted: Tue Jul 09, 2002 3:25 am    Post subject: Reply with quote

Don't forget to enable the lowlatency and preemtible options in the kernel before compiling, because default is disabled. With a preembtible kernel you really should get no mp3 choking (I have a P3-1000 and when my system is under such a heavy load that I can't do anything anymore, the mp3's are still playing fine) and no mouse choking either if you change the X priority (although I didn't test this long enough to be sure, but so far it didn't happen anymore whatever I try to compile).
Back to top
View user's profile Send private message
shadowvcd
n00b
n00b


Joined: 22 Apr 2002
Posts: 27

PostPosted: Tue Jul 09, 2002 5:58 am    Post subject: Reply with quote

My system is a 350 pentium 2 with 512 mb ram. sometimes i use @ 200mb swap, sometimes i use 400 mb swap, but I've only seen the swap used about 3 times since I installed gentoo in April.

My machine runs much faster on gentoo than on windows xp. I do slow down considerably when I'm compiling, but I don't think gentoo compiling is a fair comparison to winxp running normal apps. Try compiling something under xp, and see how much other running apps slow down.
Back to top
View user's profile Send private message
abhishek
Retired Dev
Retired Dev


Joined: 28 Jun 2002
Posts: 393
Location: Los Angeles, CA

PostPosted: Tue Jul 09, 2002 6:05 am    Post subject: Reply with quote

for an athlon tbird u at leas want
Code:
CFLAGS="-march=athlon-tbird -O3 -pipe"
CXXFLAGS="-march=athlon-tbird -O3 -pipe"
You prolly dont want a lot of swap( with only 256meg i barely hit swap) but i hit swap when i still have ram free, so i guess some stuff alwasy uses swap.
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Tue Jul 09, 2002 8:33 am    Post subject: Reply with quote

Unless you find it fun (heh), I wouldn't bother upgrading to gcc 3.1 yet, the speed increase is quite small and you migh run into lots of problems depending on what programs you use.

march=athlon* only means anything in gcc 3.1, in 2.95 march=i686 is the best you can do.

As was already suggested in the thread - make sure you have dma enabled and preempt. If you still get stuttering on your mp3's try a vanilla-sources kernel. You shouldn't get stuttering.
Back to top
View user's profile Send private message
Ozymandias
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 81
Location: Netherlands

PostPosted: Tue Jul 09, 2002 9:11 am    Post subject: about speed Reply with quote

hi there, reading this was interesting.

first off, compiling for a specified platform or with -O2 or O3 hardly changes the speed of your apps, just a little, but I don't think enough to notice. Removing debug doen't speed up apps at all, except for startup times, because the binairies will be smaller. This stuff only pays off when compiling things like X or kernel, and perhaps glibc, the rest of the apps will be waiting more for syscalls then for their own code to be run. Only run intensive programs will benefit, raytraces, gimp etc.
If xmms and X jitters during building, make sure you have the low latency and preemptable kernel patch compiled in the kernel. Let X run with a lower nice value, and give xmms more buffer, kan be done from the preferences, and say it should load any file under 12 MB interely into the mem.
Little warning: -O3 kan cause incorect binairies, though most of the times it will do just fine. Gnome advices to compile it with O2.

second, windows is MUCH faster then linux, at least when it comes to GUI. We are stuck with X. It is a beautiful system, but a little bit of a hog, and then we don't have one GUI to consider and allmost everything is themable. Just try menu's: click in a the first menu and rapidely go to the last menu on the menubar, now try that in windows, and you see the difference. Though when using XP, the results will vary, depending wether XP was meant to run on the machine, and on the amount of animation in the GUI.
Don't get me wrong, I love linux, but microsoft has the advantage of having only one GUI which integrates winmanager and widgets, which makes a microsoft system much more consistent (and faster) which is a tremendous advantage.

last, about swapping, you don't really need swap if you have a gig of mem (wish I had) but it will swap, the kernel will reserve a certain amount of mem for caching block devices (cdrom hd etc.), about half the mem. So the more memory you have, the more it will reserve, giving this mem back later when there is demand for it. But if the kernel thinks that swapping is better then to free this cache, it will swap. If swap is unavailable it will simply schrink the cache.

greetz Ozy
Back to top
View user's profile Send private message
kcsduke
n00b
n00b


Joined: 25 May 2002
Posts: 40
Location: Cambridge, MA

PostPosted: Wed Jul 10, 2002 2:02 am    Post subject: Reply with quote

shadowvcd wrote:
I do slow down considerably when I'm compiling, but I don't think gentoo compiling is a fair comparison to winxp running normal apps. Try compiling something under xp, and see how much other running apps slow down.


Don't forget that unix systems make it easy to lower the priority of jobs (I have no idea if this can be done with windows). Just use the nice command (or renice if the process is already running). When I am actively using my system and want to emerge something (say, mozilla) I type:
Code:
 nice -n 19 emerge mozilla

This causes the processes started by emerge to have the lowest priority (19). The emerge will get most of the cpu cycles when I'm not doing anything else, but if I do something cpu intensive, that process will get most of the cpu. The system remains quite responsive during the emerge.
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Wed Jul 10, 2002 4:37 am    Post subject: Reply with quote

All of this is really odd considering I have a 450mhz Celeron running gentoo with KDE and I can have mozilla open, listen to an MP3 through xmms, and emerge and I barely ever have an issue.

If a 450mhz can do it (be it intel or not, that really shouldn't matter) then anything faster should be able to do it.

kcsduke wrote:
shadowvcd wrote:
I do slow down considerably when I'm compiling, but I don't think gentoo compiling is a fair comparison to winxp running normal apps. Try compiling something under xp, and see how much other running apps slow down.


Don't forget that unix systems make it easy to lower the priority of jobs (I have no idea if this can be done with windows). Just use the nice command (or renice if the process is already running). When I am actively using my system and want to emerge something (say, mozilla) I type:
Code:
 nice -n 19 emerge mozilla

This causes the processes started by emerge to have the lowest priority (19). The emerge will get most of the cpu cycles when I'm not doing anything else, but if I do something cpu intensive, that process will get most of the cpu. The system remains quite responsive during the emerge.
Back to top
View user's profile Send private message
digitalnick
Apprentice
Apprentice


Joined: 30 Jun 2002
Posts: 243
Location: Lawrence KS USA

PostPosted: Wed Jul 10, 2002 6:12 am    Post subject: Re: about speed Reply with quote

Ozymandias wrote:

second, windows is MUCH faster then linux, at least when it comes to GUI. We are stuck with X. It is a beautiful system, but a little bit of a hog, and then we don't have one GUI to consider and allmost everything is themable. Just try menu's: click in a the first menu and rapidely go to the last menu on the menubar, now try that in windows, and you see the difference. Though when using XP, the results will vary, depending wether XP was meant to run on the machine, and on the amount of animation in the GUI.
Don't get me wrong, I love linux, but microsoft has the advantage of having only one GUI which integrates winmanager and widgets, which makes a microsoft system much more consistent (and faster) which is a tremendous advantage.

greetz Ozy


I dunno about that ... i find x to be faster than any version of windows i have delt with ... if your finding x slow maybe you should try a lighter wm instead of something like kde or gnome try fluxbox.... as for the time it takes to traverse throught the menu system i believe that is somehting that you can set in most guis some people like the pop out to come fast others like it slow.

as for the swap dont think ya need much with a gig of ram i agree 256/512 should be more than adequate
Back to top
View user's profile Send private message
mdpye
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 102
Location: Nottingham, England

PostPosted: Thu Jul 11, 2002 3:53 pm    Post subject: Reply with quote

kcsduke wrote:

Code:
 nice -n 19 emerge mozilla



Or, if you want to see just HOW poorly your system can respond, try
Code:
 nice -n -10 emerge mozilla
!!
:P
_________________
Cheers, MP
Back to top
View user's profile Send private message
clacour
n00b
n00b


Joined: 19 Apr 2002
Posts: 59
Location: Dallas, Tx USA

PostPosted: Thu Jul 11, 2002 10:08 pm    Post subject: Reply with quote

Another option that can be useful in hdparm is to enable the "unmaskIRQ" stuff. It allows other things to do IRQ interrupts while the hard drive is working. It's recommended as a way to help smooth out X, so it might be applicable to your situation. (Warning, though: With modern hardware, it's not likely to do anything too nasty, but it might be a good idea to make all your filesystems read-only before turning it on the first time. It's always worked well for me, but as the infamous phrase goes, your mileage may vary.

The swap-space stuff depends entirely on what you're going to do with the box. If you're using it as a general-purpose workstation and mess-around-with-Linux box, the 1G alone will probably be ample. If you're planning to run a large website with a massive database, you might want to get another gig, and then make twice that much swap space.

At work a box with 4 gig of memory is not at all unusual, and if we tell the DBAs "You can have 3 gig for the database", they tend to react "Is that all?". Nobody can give you recommendations for how much memory you need (and how much swap) without knowing things like what programs you're going to run, how much data those programs will be dealing with, and how critical your response time is. Also, how much disk space do you have to play around with? If what you're going to do will take 4 or 5 meg, and running out of memory would be catastrophic, go ahead and give it 2 Gig (or even more).

(Since not that long ago a machine with 128M of RAM and 256M of swap was considered fairly beefy, I suspect you won't really need any swap at all -- you described a reasonably nice home machine, not an industrial-strength server.)
Back to top
View user's profile Send private message
trythil
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 123
Location: RHIT, Terre Haute, IN, USA

PostPosted: Thu Jul 11, 2002 10:13 pm    Post subject: Reply with quote

Quote:

first off, compiling for a specified platform or with -O2 or O3 hardly changes the speed of your apps, just a little, but I don't think enough to notice.


I BEG to differ. And I've got data, too.
Optimizations make a HUGE difference. Let's test a common task, string copying, in C++:

Code:

trythil@lothlann trythil $ cat cstrtest.cpp
#include <iostream>
#include <string>

using namespace std;

int main()
{
        string t("How now brown cow");

        for(int i = 0; i <= 1000000; i++)
        {
                string *c = new string(t);
                delete c;
        }
}


Now, let's compile this with NO optimizations, and test:

Code:

trythil@lothlann trythil $ time ./a.out

real    0m1.063s
user    0m1.030s
sys     0m0.000s


Optimize:

Code:

trythil@lothlann trythil $ g++ -march=athlon-tbird -O3 cstrtest.cpp
trythil@lothlann trythil $ time ./a.out

real    0m0.359s
user    0m0.360s
sys     0m0.000s


"Small difference"? Uh, no. :)

And about the swap issue -- It's never a BAD thing to have a swap partition, in the worst-case scenario. Better to swap than to get "memory exhausted" errors.
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Fri Jul 12, 2002 1:58 am    Post subject: Reply with quote

Quote:

Quote:

first off, compiling for a specified platform or with -O2 or O3 hardly changes the speed of your apps, just a little, but I don't think enough to notice.


I BEG to differ. And I've got data, too.
Optimizations make a HUGE difference. Let's test a common task, string copying, in C++:

He was comparing -O2 and -O3. The only difference is functions are inlined. This increases code size which negatively effects caches, but speeds things up by removing the jumps to the functions, depending on the code and the hardware it's running on it can either be faster or slower but either way the difference between -O2 and -O3 is almost always very small.

Quote:

Removing debug doen't speed up apps at all, except for startup times, because the binairies will be smaller.

debugging greatly increases the code size and this _does_ significantly effect performance.
Back to top
View user's profile Send private message
jnials
n00b
n00b


Joined: 12 Jul 2002
Posts: 9
Location: Bertram, TX

PostPosted: Fri Jul 12, 2002 2:22 am    Post subject: Swap space Reply with quote

Also be careful to understand that while linux doesn't require swap space with sufficient memory, other unix variants do.

-Jon
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Fri Jul 12, 2002 5:07 am    Post subject: Reply with quote

I would hope that in the test that was done with that short stringcopying cpp file, the only difference was the -O2 and -O3. I changed the i variable to 100,000,000 and I got the following:
For -O2 optimized (no architecture at all, just -O2 optimizer)
real 0m28.136s
user 0m28.120s
sys 0m0.010s
and for -O3 optimization (same as above, except -O3)
real 0m27.811s
user 0m27.810s
sys 0m0.000s

I tried it several times, and it only varied by 0.010s. In the real world, this would be in several areas.. from string copying, virtual function inlining, etc. Would save a good deal (good deal being feeling a bit snappier, less bogged down).
It's not enough to turn a P2 133 into a P3 166, but it's enough to make the system feel "cleaner".

Malakin wrote:
Quote:

Quote:

first off, compiling for a specified platform or with -O2 or O3 hardly changes the speed of your apps, just a little, but I don't think enough to notice.


I BEG to differ. And I've got data, too.
Optimizations make a HUGE difference. Let's test a common task, string copying, in C++:

He was comparing -O2 and -O3. The only difference is functions are inlined. This increases code size which negatively effects caches, but speeds things up by removing the jumps to the functions, depending on the code and the hardware it's running on it can either be faster or slower but either way the difference between -O2 and -O3 is almost always very small.

Quote:

Removing debug doen't speed up apps at all, except for startup times, because the binairies will be smaller.



debugging greatly increases the code size and this _does_ significantly effect performance.
Back to top
View user's profile Send private message
trythil
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 123
Location: RHIT, Terre Haute, IN, USA

PostPosted: Fri Jul 12, 2002 6:41 am    Post subject: Reply with quote

Oops, sorry, I misread. :oops:

Code:

trythil@lothlann trythil $ g++ -O2 -march=athlon-tbird cstrtest.cpp
trythil@lothlann trythil $ time ./a.out

real    0m0.705s
user    0m0.700s
sys     0m0.000s
trythil@lothlann trythil $ g++ -O3 -march=athlon-tbird cstrtest.cpp
trythil@lothlann trythil $ time ./a.out

real    0m0.330s
user    0m0.330s
sys     0m0.000s


Perhaps not -~.7 seconds, but -.375 seconds is still a significant gain. Thus I stand by my assertion that it's not just a "small difference". :)

Another thing about debugging code: Programmers often insert calls to write to the error stream as debug measures. That sort of write is really, really slow. (Relatively speaking, anyway.)
Back to top
View user's profile Send private message
tyreth
Apprentice
Apprentice


Joined: 27 May 2002
Posts: 238
Location: Melbourne, Australia

PostPosted: Fri Jul 12, 2002 4:21 pm    Post subject: Reply with quote

trythil wrote:

Perhaps not -~.7 seconds, but -.375 seconds is still a significant gain. Thus I stand by my assertion that it's not just a "small difference". :)

Another thing about debugging code: Programmers often insert calls to write to the error stream as debug measures. That sort of write is really, really slow. (Relatively speaking, anyway.)


Hmm, I tried your example and my results for -O2 and -O3 were, respectively:
Code:

real    0m0.292s
user    0m0.281s
sys     0m0.003s

Code:

real    0m0.296s
user    0m0.287s
sys     0m0.000s


The difference must be that I'm using gcc 2.95.3 and you appear to be using gcc 3.1 or so. In which case, it looks like there's some nice optimisations in store when I use gcc 3.1 (or it's slower unless you use -O3) :)
Back to top
View user's profile Send private message
trythil
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 123
Location: RHIT, Terre Haute, IN, USA

PostPosted: Fri Jul 12, 2002 4:40 pm    Post subject: Reply with quote

Yeah, it's GCC 3.1, running on an Athlon Thunderbird @ 850 MHz with 384 MB of RAM. I should have made that evident. (This is what comes of reading these posts on little sleep, I suppose. :) )
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Sat Jul 13, 2002 5:46 am    Post subject: Reply with quote

The difference between -O2 and -O3 in gcc 2.95 and 3.1 differ.

With 2.95 the only thing -O3 gives you over -O2 is -finline-functions.

With 3.1 you also get -frename-registers.

This would explain the difference between your results.

References:
http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC2
http://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Optimize-Options.html#Optimize%20Options
Back to top
View user's profile Send private message
Jocco
n00b
n00b


Joined: 03 Jul 2002
Posts: 24

PostPosted: Tue Jul 23, 2002 3:51 am    Post subject: Thanks you guys! Reply with quote

You guys rock, thanks for all the info!! Gentoo is awesome, if for no reason than the support. And talk about rock solid, this distro is the best I've seen yet. Still having some problems with speed, but with all the help and information in this thread, I'm sure this thing is going to fly in a week or two.

Unfortunatley, Im a busy guy and have little time to tailor Gentoo. I'll get it on. Oh yeaaahh...


Thanks again ppl.

J.
Back to top
View user's profile Send private message
StrCrssd
n00b
n00b


Joined: 17 Apr 2002
Posts: 68
Location: McAllen, TX USA

PostPosted: Tue Jul 23, 2002 7:09 am    Post subject: Gentoo Sources Reply with quote

I was having a similar problem on a P3-850 with 768M of RAM.

I suspected the issue may have been pre-empt (for no real reason), so I compiled the redhat kernel with low-latencey and no pre-empt, and things have gotten better.

Just thought I'd throw in my $.02
_________________
StrCrssd

Give a man enough rope, he'll hang himself. Teach a man to make rope, he'll hang other people.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum