Hello,

This may not be the right place for this question, but hopefully the
knowledgeable readers of this list will know the answer or be able to direct
me to the appropriate place.

I'm writing an R package, mostly in C with the R portion acting as a
front-end. The C code calls the pow function (from math.h) to compute
powers, and it does so quite often. Nothing special so far.

I have two platforms on which I am working. One is a new Macbook Pro 2.5 GHz
Intel Core 2 Duo, and the other is an older iMac PowerPC G4 1.8GHz.

When profiling the code using Sampler.app on the Intel Macbook, it indicated
that about 30% of the time was being spent on "pow$fenv_access_off" in the
libSystem.B.dylib library. By contrast, on the PowerPC iMac, only 0.7% is
spent on "PowerInner" (which I assume to be the equivalent, since nothing
else even shows up in the profiler).

Something similar seems to be the problem with log. On the Intel Macbook,
log$fenv_access_off consumes 7% of the time, and on the PowerPC, log only
consumes 0.2%.

I don't know what to make of this discrepancy, but it seems to suggest that
pow and log are much slower on the Macbook than on the PowerPC (unless all
the rest of my code is just blazingly fast on Intel).

Am I misinterpreting the Sampler.app output? Are these known performance
problems? Is it likely that my code calling the functions incorrectly, or I
am using bad datatypes? I would appreciate any ideas. If it would help, I
can try to create a short code snippet that reproduces the problem.

Cheers,
Enrico

	[[alternative HTML version deleted]]

