On Fri, 30 Jan 2009, Elad Lahav wrote: > > My expectation was that something like the following loop would run faster on > 64 bit: > > unsigned long array[ARR_SIZE]; > for (i = 0; i < ARR_SIZE; i++) { > array[i] ^= (unsigned long)SOME_CONSTANT; > } > > However, the two previous replies seem to suggest that there should be no > performance advantage to running 64 bit applications. So which of these > options is true: > > 1. There may be a performance advantage to running 64 bit code, but > applications are not tuned to exploit it; or > 2. There is no performance advantage (under SPARC) in running 64 bit code.
I have seen negligible difference on SPARC for 64-bit vs 32-bit code. I rarely see evidence of a performance boost, or penalty. Things are much different for Opteron where 64-bit code is often faster, and sometimes considerably so. It is true that your loop has to move 2X more data if unsigned long is 64-bit. Access latency and cache effects may nullify most of the difference. SPARC supports pre-fetch so with good pre-fetch, the data may already be there by the time it is actually consumed. On SPARC your loop is likely to be usefully faster if it counts down (and tests for zero) rather than up. Define SOME_CONSTANT using the "UL" type suffix if you want to make absolutely sure that its storage size is what you expect, and then you can remove the cast. Bob ====================================== Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org