You are not logged in.

#1 2003-01-30 05:53:17

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

AL's optimization?

What are AL's optimization codes and other feartures to speed up the system and applications beside i686? I have seen other distros using following codes and tools:

1) "-march=i686 -O3 -pipe -fomit-frame-pointer" to optimize all KDE and GUI applications.
2) binutils to take advantage of combreloc. 
4) glibc with binutils installed. 
5) hdparm speeds up the hard disk. 
6) fam allows KDE to track files quicker.

Offline

#2 2003-01-30 09:40:58

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: AL's optimization?

i believe fam is in the trees somewhere and hdparm is definitely in the arch tree cuz i use it to get my dvd working properly.

i can't tell you for sure what the reasoning is for just using the i686 -02 -pipe instead of 03 -fomit-frame-pionter except to conjecture that perhaps those optimizations only benefit a select few while -02 -pipe may serve that whole of the arch community.

i can't speak to #2

4 (3) do you mean glibc with binutils ./configure flag or binutils and glibc both installed. because unless my eyes were decieving me moment ago they are bothinstalled as base pacakges.


AKA uknowme

I am not your friend

Offline

#3 2003-01-30 13:18:03

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: AL's optimization?

About glibc settings I don't know..... I copied the idea from Gentoo website.

One of the reasons why I brought up this optimization question, KDE is slow though binutils and hdparm were installed.
I found fam among unofficial packages and portmap (current). After intalling both packages, now my KDE works much better. Thanks.

If anyone wants to use fam..... add "fam" (no quotes) in /etc/rc.local file to run it when booting the system.

Offline

#4 2003-01-30 15:17:16

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: AL's optimization?

well i am glad i helped you with fam i am hoping apeiro will let you know why arch uses the -02 -pipe instead of -03 -pipe -fomit-frame-pointer. i am not well versed on what these optimizations do exactly.


AKA uknowme

I am not your friend

Offline

#5 2003-01-30 16:30:08

ody
Member
From: Manchester, UK
Registered: 2002-08-12
Posts: 212
Website

Re: AL's optimization?

problem with -O3 is that if you package things up useing that level its very unlikely going to work well if at all on another i686.. because at this level the code is closely tied with the cpu.. where at level 2 its more generic.

Offline

#6 2003-01-30 17:01:29

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: AL's optimization?

thanks ody i just was reading about that in the linux from scratch manual.
smile


AKA uknowme

I am not your friend

Offline

#7 2003-01-30 23:10:34

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: AL's optimization?

ody nailed it...  -O3 is well-suited if you're building your own apps from source for your box and your box alone.  But -O3 optimizations are more tightly tied to a specific architecture (p3/athlon/celeron coppermine/etc) and may fail on other i686 implementations.

Offline

#8 2003-01-31 00:01:53

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: AL's optimization?

apeiro wrote:

But -O3 optimizations are more tightly tied to a specific architecture (p3/athlon/celeron coppermine/etc) and may fail on other i686 implementations.

Depending on how complex the software, -O3 et.al can even cause problems on the box it's compiling on. Some mysterious bugs have been tracked to just such optimizations including odd segmentation errors.


BluPhoenyx

Offline

#9 2003-02-03 11:58:47

Sp00n
Member
Registered: 2002-09-14
Posts: 23

Re: AL's optimization?

either way its not worth the time for the developers to sit down and figure out which packages can use -03 -pipe -fomit-frame-pointer, i'd rahter they work on more important things then makikng kde load .3432 seconds faster.  but i do think this would be a cool idea. if somehow the abs used a global file for optimizations, like gentoo, but if you wanted to build lets say xfree with the optimizations you could set the flags and enable it it, then goto /usr/abs/....... and issue makepkg and get an optimized pkg. smile  just a thought

Offline

#10 2003-02-03 15:39:03

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: AL's optimization?

Sp00n wrote:

....but i do think this would be a cool idea. if somehow the abs used a global file for optimizations, like gentoo, but if you wanted to build lets say xfree with the optimizations you could set the flags and enable it it, then goto /usr/abs/....... and issue makepkg and get an optimized pkg. smile  just a thought

Your thought is also what I have in my mind. On topic: "What will Arch Linux 1.0 become?" is a discussion about it.
http://bbs.archlinux.org/viewtopic.php?t=336

File /etc/makepkg.conf could have sample codes like this (copied from Gentoo Linux):

# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon optimized (but binaries
# will run on any x86 system)
#CHOST="i686-pc-linux-gnu"
#CFLAGS="-mcpu=i686 -O3 -pipe"
#CXXFLAGS="-mcpu=i686 -O3 -pipe"

# Pentium Pro/Pentium II/Pentium III+/Pentium 4/Athlon exclusive (binaries
# will use the P6 instruction set and only run on P6+ systems)
#CHOST="i686-pc-linux-gnu"
#CFLAGS="-march=i686 -O3 -pipe"
#CXXFLAGS="-march=i686 -O3 -pipe"

# Pentium/Pentium MMX
#CFLAGS="-march=i586 -O3 -pipe"
#CXXFLAGS="-march=i586 -O3 -pipe"

# K6
#CFLAGS="-mcpu=k6 -march=k6 -O3 -pipe"
#CXXFLAGS="-mcpu=k6 -march=k6 -O3 -pipe"

#Duron
# CFLAGS="-march=athlon_xp -O2 -pipe"

This was my codes when running Gentoo:

CFLAGS="-march=pentium3 -mcpu=pentium3 -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=pentium3 -mcpu=pentium3 -O3 -pipe -fomit-frame-pointer"

Offline

#11 2003-02-03 23:26:09

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: AL's optimization?

Hmmm, why make things more complicated when you can set these options in the environment already? You still have control by overriding them on the command line or the build script if you use one.


BluPhoenyx

Offline

#12 2003-02-04 00:41:30

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,176
Website

Re: AL's optimization?

BluPhoenyx wrote:

Hmmm, why make things more complicated when you can set these options in the environment already?

What do you mean with "environment"? Can you give an example.

Offline

#13 2003-02-04 03:06:55

BluPhoenyx
Member
Registered: 2002-12-23
Posts: 239

Re: AL's optimization?

I knew when I mentioned this that I would need an example. smile

Actually, it's very simple to do for standard settings. You can specify these in either the /etc/profile or in the .bashrc file for the user who does the compiling. What we want is to set environment variables somewhat similar to the $PATH or $HOME variables. Some common ones are CC for compiler and CFLAGS for compiler options.

For BASH either of these formats will work. The first is the definition and export and the second example simply exports the text. Quotes are optional but may be necessary for certain text strings to be accepted. Other shells may vary.

CFLAGS='-O3 -march=i686'
export CFLAGS

export CC=gcc

You can then bypass these for specific values on a command line or in the configure phase depending on how you compile programs. Of course with bash scripting you have many more options but bash is not my forte'.

[user@pc]$ export CC=g++ && make

Of course, systems may vary as well as options allowed when building programs. Some programs have a lot of options and work best when scripted, IMHO.


BluPhoenyx

Offline

Board footer

Powered by FluxBB