Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Best CFLAGS for low memory/load times?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
sindre
Guru
Guru


Joined: 01 Nov 2002
Posts: 315
Location: Norway

PostPosted: Tue Feb 25, 2003 5:05 pm    Post subject: Best CFLAGS for low memory/load times? Reply with quote

What would be the "best" CFLAGS to use on a computer with low memory, but a descent processor? Also the HD is quite slow, so I suffer from low memory and long load times.

Which is better? -Os, -O3 or -O2? Any other important flags? Any gain if I use glibc-2.3.2_pre1 over glibc-2.3.1? I also plan to use prelinking.

Grateful for any input.
Back to top
View user's profile Send private message
PT_LAmb
Guru
Guru


Joined: 22 Apr 2002
Posts: 332
Location: Lisboa (Lisbon), Portugal

PostPosted: Tue Feb 25, 2003 10:38 pm    Post subject: Reply with quote

I don't know much about the subject, but can tell you the following:

-O3 and -O2, are speed flags, setting one of them will optimize the binary to be a bit faster then a standard compiled one. I once read that -O3 doesn't improve much over -O2, can anyone confirm this?

-Os is a size optimization, setting this will reduce the binary file size, possibly compromising speed. I don't know if this optimization is considerable over the speed ones, but I sense that reducing the file size will also reduce the memory usage, but this is only significant if the program doesn't allocate much dynamic memory.

If you're running on a x86 machine, you can safely append -fomit-frame-pointer, because the frame-pointer is not needed on x86.
sindre wrote:
Any gain if I use glibc-2.3.2_pre1 over glibc-2.3.1?

I really don't know...
sindre wrote:
I also plan to use prelinking.

Prelinking will reduce your load time considerably considering you have a slow HD.

Good luck,
Ricardo Cordeiro :)

PS - Please correct me if I'm wrong.
_________________
SETI@Home - http://setiathome.ssl.berkeley.edu/
Back to top
View user's profile Send private message
invaderzim
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 93
Location: Louisville, KY

PostPosted: Wed Feb 26, 2003 2:58 am    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic.php?t=5717&postdays=0&postorder=asc&start=316
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Wed Feb 26, 2003 3:51 am    Post subject: Reply with quote

Yep, your much better of using -Os. Since you have small memory, you are going to see much more of a speedup than optimising with -03 (optimises code, but increases binary size, which then has to be stored in working memory).

-O3 only includes 2 extra flags than -O3, those two flags only operate in special conditions, but can sometimes act negatively for performance. -O2 is a lot more sensible and safer.

Don't know about GLIBC, I would definately use the stable version. The stable version has reliable prelinking too.
Back to top
View user's profile Send private message
PT_LAmb
Guru
Guru


Joined: 22 Apr 2002
Posts: 332
Location: Lisboa (Lisbon), Portugal

PostPosted: Thu Feb 27, 2003 1:35 am    Post subject: Reply with quote

puddpunk, can you tell me a page that explains the few differences between -O2 and -O3, and their positive/negative impact on the system?

Thanks in advance,
Ricardo Cordeiro :)
_________________
SETI@Home - http://setiathome.ssl.berkeley.edu/
Back to top
View user's profile Send private message
invaderzim
Tux's lil' helper
Tux's lil' helper


Joined: 16 Aug 2002
Posts: 93
Location: Louisville, KY

PostPosted: Thu Feb 27, 2003 2:32 am    Post subject: Reply with quote

look at my post.....
Back to top
View user's profile Send private message
David_Escott
l33t
l33t


Joined: 12 Jan 2003
Posts: 952
Location: Boston, MA

PostPosted: Thu Feb 27, 2003 3:58 am    Post subject: Reply with quote

definitely look at that other thread as benchmarks can tell a lot more than anything else. But I would consider using speed optimizations for low end libraries (libc and such) and then size for user end things (gnome kde etc)
your ram concerns will really kick in when you get into X and the various userland programs, but a good fast core underneath that will help too. You should also look at the cache size of your processor since cache misses will make you fall back to ram which can slow things down.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Feb 27, 2003 7:13 am    Post subject: Reply with quote

invaderzim wrote:
https://forums.gentoo.org/viewtopic.php?t=5717&postdays=0&postorder=asc&start=316
Followups to this thread.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
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