On Thu, Apr 24, 2014 at 3:09 PM, Jeff Allen <ja.py@farowl.co.uk> wrote:
Yes, I expect those two are in-lined (is that what you mean?), but a glance into the source of either BigDecimal or even the highly-optimised Double.toString(double) will convince you the call overhead (or its absence) in using those methods is of no consequence by comparison.

By intrinsified, I mean that a method like Math.getExponent is likely to compiled by the JIT to something on the order of a single machine instruction, so that's close to ultimate inlining :) (Of course better is when there's even no work done - it's zero cost - and sometimes the JVM does do that too.) To actually verify what goes on requires starting with this tooling: https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly - I have not looked myself.

But that analysis is not at all not necessary. As you mention, there's a lot more work going on elsewhere, some of which hypothetically might be shaved off in certain cases around large exponents, but working code trumps any theoretical better performing code.

- Jim