Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Post by Ted Su » Sat, 07 Feb 2004 00:50:48



Hi,

I'm running on a

SunOS enigma 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-5_10

Using cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15,
I build a 32 bit version (no special compile flags except for -O)
and a 64 bit version ( -xtarget=ultra -xarch=v9 -dalign ).

I then build a 32 bit executable and a 64 bit executable and run them.

Running on the same machine, my 64 bit executable is approximately 20%
SLOWER and I'm trying to get a handle of why this should be the case.
The computations being done are fairly floating point intensive.

How is that the emulated 32 bit program runs faster than the 64 bit
version?

Thanks,

Ted

 
 
 

Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Post by Darren Dunha » Sat, 07 Feb 2004 01:57:08



> Running on the same machine, my 64 bit executable is approximately 20%
> SLOWER and I'm trying to get a handle of why this should be the case.
> The computations being done are fairly floating point intensive.

That's possible.

Quote:> How is that the emulated 32 bit program runs faster than the 64 bit
> version?

What do you mean by "emulated" there?  Why would anything be emulated in
your examples?

It is possible to construct a program that uses loops that will fit into
the on-CPU chip cache with 32-bit pointers, but will not fit into the
cache when it uses 64-bit pointers (simply because the size of the code
comprising the loop is now larger).  When this happens, it may cause a
severe performance reduction.

--

Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

 
 
 

Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Post by Rich Tee » Sat, 07 Feb 2004 02:53:38



> Using cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15,
> I build a 32 bit version (no special compile flags except for -O)
> and a 64 bit version ( -xtarget=ultra -xarch=v9 -dalign ).

> I then build a 32 bit executable and a 64 bit executable and run them.

> Running on the same machine, my 64 bit executable is approximately 20%
> SLOWER and I'm trying to get a handle of why this should be the case.
> The computations being done are fairly floating point intensive.

First things first: use the same flags, where possible.  Use -O
for both, and add -xarch=v9 for the 64-bit build.  If you use
xtarget and/or dalign, use it for both builds.

WHat results do you get when you recompile them like this?

Quote:> How is that the emulated 32 bit program runs faster than the 64 bit
> version?

It's not an emulated program.  The UltraSPARC processor runs 32-bit
AND 64-bit code natively.

In the 64-bit programming model (called LP64), longs and pointers
are 64 bits wide, rather than 32.  This means that less of them
will fit into the cache, having a performance impact.

HTH,

--
Rich Teer, SCNA, SCSA

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Post by Keith Kr » Sat, 07 Feb 2004 03:37:01


Remember that with 64 bit opcodes your instruction word is twice as
large.  A 64 bit chip simply has to do more work to get things done.
So what's the advantage?  Bandwidth.  When dealing with large
datasets, 64 bit apps really shine.  A (possibly bad) analogy:

A corvette can travel at 150mph and carry 100 pounds of cement at a
time
A Mack truck can travel 80mph and carry 1000 pounds of cement at a
time

If you're moving small amounts of data, 32 bit will be faster.  If you
need to move large amounts of data, a 64 bit app can do it faster.

I'm sure I've messed up a few points and I'm sure someone will correct
them.

Check this thread:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=3...


> Hi,

> I'm running on a

> SunOS enigma 5.8 Generic_108528-12 sun4u sparc SUNW,Ultra-5_10

> Using cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15,
> I build a 32 bit version (no special compile flags except for -O)
> and a 64 bit version ( -xtarget=ultra -xarch=v9 -dalign ).

> I then build a 32 bit executable and a 64 bit executable and run them.

> Running on the same machine, my 64 bit executable is approximately 20%
> SLOWER and I'm trying to get a handle of why this should be the case.
> The computations being done are fairly floating point intensive.

> How is that the emulated 32 bit program runs faster than the 64 bit
> version?

> Thanks,

> Ted

 
 
 

Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Post by Robin KA » Sat, 07 Feb 2004 04:27:33



> Remember that with 64 bit opcodes your instruction word is twice as
> large.

SPARCv9 instructions are still only 32 bits wide.

--
Wishing you good fortune,
--Robin Kay-- (komadori)

 
 
 

Why is my 32 bit executable faster than 64 bit build on ultra sparc.

Post by Tony Walto » Sat, 07 Feb 2004 04:10:48



> Remember that with 64 bit opcodes your instruction word is twice as
> large.  A 64 bit chip simply has to do more work to get things done.
> So what's the advantage?

..

Quote:

> I'm sure I've messed up a few points and I'm sure someone will correct
> them.

The point about opcode lengths is wrong, for one. SPARC opcodes are 4
bytes long, period.

--
Tony

 
 
 

1. Userspaces 32-bit and 64-bit on Solaris Ultra Sparc

Hi guys,

Thanks for your feedback on the performance
issue.

I wanted to know two things about userspaces.

1) How does one know which userspace one is working
on from the $ prompt.

2) Can we run a 64-bit application on a 32-bit
userspace with 64-bit Kernel?

Might be trivial for you guys but it would
really help me out.

Thanks.
ASG

2. Stupid chgrp trick as root: need help

3. Best Build machine: KT333 w/ 32 bit PCI or KT266 w/ 64 bit pci

4. Finding the soundcard

5. Sparc problem: userspace 32 bit, kernel 64 bit

6. Shared libs and exported symbols

7. Upgrading from 32-Bit Sparc-Kernel to 64-Bit sparcv9-Kernel??

8. linking problems -- ld.so configuration?

9. Solaris 9 installed with 32 & 64 bit supports but boots in 32 bit mode

10. performance of runing 32/64 bit program in 64 bit kernel.

11. How 32 bit driver can be ported to 64 bit driver?

12. 32 bits vs. 64 bits Oracle

13. 32 bit or 64 bit