Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Xfce 4.10 march=i686 vs xfce 4.10 march=native(k8)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
utops
n00b
n00b


Joined: 10 Oct 2012
Posts: 4

PostPosted: Wed Oct 10, 2012 7:48 pm    Post subject: Xfce 4.10 march=i686 vs xfce 4.10 march=native(k8) Reply with quote

Hi

Xfce 4.10 on arch stadard i686 is fast,Xfce 4.10 compiled on march=native in gentoo is slugish and feels "dirty" i can run both at the same time in both same class machines. By slow and dirty i mean that k8 compiled copy when loading, first loads panels,then texture/color/system theme on panel and disk crunching hard for 10-15 seconds before enviroment fully loads, no errors reported. i686 version on arch just loads up everything instantly and im good to go.
Deafault xfce4 theme.
First i was thinking that one of the pc's got hardware problem,but when i switched disks it was not different.
Compiled xfce 4.10 from abs (arch building system - portage like) for k8 turn good working xfce4 in to slug,just like in gentoo...
Just wonder if gcc don't like amd's...
_________________
sleep is good.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Oct 10, 2012 10:46 pm    Post subject: Reply with quote

For anyone interested, here's the Arch thread.
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Thu Oct 11, 2012 4:28 am    Post subject: Reply with quote

So you are compiling xfce4 one time as 32-bit code (-march=i686)
and the second time as 64-bit code (-march=native on amd64 cpus),
and running them with the same kernels and glibc? Or do you have
multiple glibcs, one for 32-bit applications and the other for 64-bit
applications?

There could be performance differences (loop code for loops that
run often fits in icache on one but not the other), side-effects in
addressing memory beyond 4gb, but I do not see how this would
show up as disk thrashing. It sounds more like memory allocations
are pushing the system to swap in one case but not the other.
_________________
TIA
Back to top
View user's profile Send private message
utops
n00b
n00b


Joined: 10 Oct 2012
Posts: 4

PostPosted: Thu Oct 11, 2012 6:30 am    Post subject: Reply with quote

wcg wrote:
So you are compiling xfce4 one time as 32-bit code (-march=i686)
and the second time as 64-bit code...


Not at all,im running amd64 in 32bit legacy mode and in theory it should be as fast as any 32bit processor (at least amd64 manual said so) . march=native or march=k8 doesn't enable 64 bit instructions when chost=i686 is definied or 32bit glibc/kernel - can't said for sure,because i never tried to convert system from 32 to 64 on the run.
Maybe someone with kx family processor running 32 bit mode, can compile xfce4 for pentium pro(i686) then k8 and compare just to test if really gcc can't in to kx optimalizations or it's just me.
_________________
sleep is good.
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Thu Oct 11, 2012 11:33 pm    Post subject: Reply with quote

Actually, on reminisence, something about your story rings
a bell.

It was back in the 2.6.3x kernel series. After an emerge {system,world}
update, suddenly X and xfce started slower than usual, noticeably
slower. (I start both at once with startx, with "exec /usr/bin/startxfce4"
in ~/.xinitrc.)

It was faintly annoying, but I did not have time to investigate it.
IIRC the system update did not include a kernel update, so that
was not the cause. It was certainly not a showstopper, and I
assumed that it would either fix itself in a later update or not.

It never occurred to me that it could be a difference in 32-bit vs
64-bit -march in CFLAGS, because my system had been 64-bit
from the start. CHOST was x86_64-pc-linux-gnu. CFLAGS were
"-march=native -O2 -fno-strict-aliasing -pipe -Wall", CXXFLAGS
added "-fpermissive" to that. mmx, 3dnow, sse etc were enabled
in USE flags for the few packages that have assembly-level support
for them, but there was nothing explicit in CFLAGS either enabling
or disabling them.

Thinking about it now, it could be that xfce4's search order for
something that it needs to load from disk changed. ("It is looking
in the wrong place first for icons," I thought.) But it could also
have been the memory layout of instructions. Some loop(s)
that loaded on a cache line boundary and fit in the icache perhaps
began to load starting elsewhere in a cache line, causing a cache
miss on every loop iteration. Loops that used to fit in a cache line
entirely could now extend beyond one cache line, too. I am used
to seeing that when people add sanity checks to their code,
making sequences of instructions that originally fit into cache lines
no longer fit. It is the price of not crashing or faster debugging when
bugs turn up (better error reports).

What was the cause then and what is the cause of the behavior
you are seeing would be sheer speculation without any evidence
to support it. Using a 32-bit CHOST in make.conf and a 64-bit
"-march=" in CFLAGS could cause gcc to be compiling with some
strange, unexpected mixtures of instruction set flags, though.
It is perhaps more surprising that it runs at all than that it runs
slow.
_________________
TIA
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Oct 12, 2012 2:19 am    Post subject: Reply with quote

Run prelink?
Back to top
View user's profile Send private message
utops
n00b
n00b


Joined: 10 Oct 2012
Posts: 4

PostPosted: Fri Oct 12, 2012 11:05 am    Post subject: Reply with quote

wcg wrote:



What was the cause then and what is the cause of the behavior
you are seeing would be sheer speculation without any evidence
to support it. Using a 32-bit CHOST in make.conf and a 64-bit
"-march=" in CFLAGS could cause gcc to be compiling with some
strange, unexpected mixtures of instruction set flags, though.
It is perhaps more surprising that it runs at all than that it runs
slow.


But amd64 processors fully supports 32 bit mode without any problem,at least it should by design and it's documented in amd manual that it is and march=k8 do not turn on any specific flags for 64 bit mode,just sse1,sse2,sse3,3dnow,3dnow_a,mmx,mmx_ext. ?
Maybe i should try "march=athlon-xp -msse2 -msse3 ..." just to be sure.
I try this and see what happens
_________________
sleep is good.
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Mon Oct 15, 2012 1:11 pm    Post subject: Reply with quote

I know the 64-bit native K8 architecture will run 32-bit code
(I got a Compaq, ie HP box with an Athlon X2 in it and 32-bit
Vista factory installed, for example). I simply suspect that
you need to make the choice between instructions for a
32-bit architecture (like -march=i686) and instructions
for a 64-bit architecture (-march=k8 in your case) to get good
code out of gcc. "-march=k8 -m32" is probably not as well
tested and optimized. I suspect that most k8 users want
the 64-bit address space, 64-bit sizeof(long), etc. What is
gcc going to do with a 64-bit kernel data type if you effectively
pass it -m32? I think it is going to code operations on 64-bit
data types like it would "long long" in a 32-bit runtime, which
is pretty slow compared to native 64-bit instructions where
you can use the whole register width in a single instruction.

That may not be your whole problem (X-and-xfce4 slowed down
for me at X start without having that particular problem, since
I was compiling for 64-bit K8 before and after), but that could
be something that slows down X and xfce4 once they are up
and running.
_________________
TIA
Back to top
View user's profile Send private message
utops
n00b
n00b


Joined: 10 Oct 2012
Posts: 4

PostPosted: Mon Oct 15, 2012 8:32 pm    Post subject: Reply with quote

Thx for the info and support wcg.

Just added "-m32" in to CFLAGS , now binaries are smaller and seem to be running faster,but this is just purly eye observation,so placebo syndome may be in effect. Anyway i stick to it and see how it goes for some time.
_________________
sleep is good.
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Tue Oct 16, 2012 12:01 pm    Post subject: Reply with quote

Other people have done 32-bit vs 64-bit tests on the same x86-64 cpus,
same ram, etc, running the same software compiled in 32-bit or 64-bit mode:
http://217.118.24.123/index.php?option=com_content&view=article&id=5920:ubuntu-1210-32-bit-vs-64-bit-linux-performance&catid=35:64bit-linux&Itemid=83
_________________
TIA
Back to top
View user's profile Send private message
wcg
Guru
Guru


Joined: 06 Jan 2009
Posts: 588

PostPosted: Mon Oct 22, 2012 3:01 am    Post subject: Reply with quote

PS:

Analysis of what issues 32-bit vs 64-bit code face on x86-64 cpus:
http://compilers.iecc.com/comparch/article/07-04-040

A couple of specific examples of programs that are faster
compiled as 64-bit code than as 32-bit code on 64-bit processors
(like K8, core2, etc):
http://newsgroups.derkeiler.com/Archive/Comp/comp.arch/2007-04/msg00220.html

As for the "2gb of ram" mentioned in the Phoronix ubuntu test summary,
adding more ram is nearly always good, because it means you reach
the level of memory allocation where the system needs to swap
later, but I did not notice much swapping going on running 64-bit code
on a 1gb athlon X2. Linking Firefox maybe when building it (ld uses
a huge amount of ram to load all of the libraries that Firefox links
to at build time.) But I did not noticing any swapping while browsing
around on the www and doing other desktop tasks. I do not see 2gb
of ram as a prerequisite for getting good performance out of 64-bit code
on a 64-bit x86-64 cpu.
_________________
TIA
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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