Operating System - HP-UX
1825058 Members
4352 Online
109679 Solutions
New Discussion юеВ

32 bit vs 64 bit compilation

 
Michael Selvesteen_2
Trusted Contributor

32 bit vs 64 bit compilation

Hello All,

What is the difference between compiling an application as 32 bit or 64 bit in hp-ux?
Is 64 bit is more advantageous than 32 bit compilation in memory usage, speed etc...?

Thanks for your help
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: 32 bit vs 64 bit compilation

You should not think of of 64-bit as a performance enhancer but rather as a resource unlimiter. The address space in 64-bit land is much, much larger and for all intents and purposes you can forget about the 1GB quadrant boundaries that limit 32-bit PA-RISC code. Because the pointers and data structures are larger, the code itself will actually execute more slowly in 64-bit land but applications which can take advantage of the much larger address space (and thus cache more) can run faster than their 32-bit counterparts.
If it ain't broke, I can fix that.
Biswajit Tripathy
Honored Contributor

Re: 32 bit vs 64 bit compilation

32 bit binaries are meant to run on 32bit HP-UX
systems and 64 bits binaries on 64bit HP-UX systems,
ofcourse. 32 bit HP-UX is only supported for HP-UX
11.00 and HP-UX 11.11 (or 11i ver 1) and not on later
HP-UX versions (like 11i v1.6 or v2). 32 bit binaries are
guarrented to run on 64 bit systems, but 64 bit
binaries on 64 bit systems are most efficient. If
possible, I would advice you to compile your application
for 64 bit if it's intended to run on 64 bit system.

- Biswajit

:-)
Biswajit Tripathy
Honored Contributor

Re: 32 bit vs 64 bit compilation

Ravi_8
Honored Contributor

Re: 32 bit vs 64 bit compilation


Applications using 64 bit are must faster than 32 bit, because they use more address spacing
never give up
MAUCCI_2
Frequent Advisor

Re: 32 bit vs 64 bit compilation

Sorry Ravi,

but from my experience, when benchmarking the single same code compiled in both 32 then 64 bit (on HPUX) and comparing the perf, I usually see between a raw 5-10% perf decrease from 32 to 64 bit, i.e. 64bit app is a bit slower.

This does not change anything to the fact that 64bit enables such a larger address space.

But on the pure perf aspect, 64-bit code is not faster than 32-bit code.

++Cyrille
Fred Ruffet
Honored Contributor

Re: 32 bit vs 64 bit compilation

Ravi is right... but Cyrille too.

It depends on what you compile. If you compile the same application in 32 bit and 64 bit it will not be faster on 64 bit version.
If application is rewritten with 64 bit specific code or if application code includes the right #ifdef code, then it will be faster on 64 bit version (with 64 bit registers operations, arithmetic will be better)

Regards,

Fred

--

"Reality is just a point of view." (P. K. D.)
Michael Selvesteen_2
Trusted Contributor

Re: 32 bit vs 64 bit compilation

Thank you All