classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java.lang.StrictMath


From: Tom Tromey
Subject: Re: java.lang.StrictMath
Date: 15 Feb 2002 00:31:59 -0700

>>>>> "Per" == Per Bothner <address@hidden> writes:

Per> For JDK, or other system with a good JIT, it is probably faster
Per> to use Java code.

If the Java code is restricted enough then I think gcj will be as good
as C.

For best performance I think the code would have to:

* Not make static or final ("nonvirtual") method calls
  (These induce overhead relative to C++)
* Not use arrays
  (C++ does check bounds)
* Not "look like" it might throw an exception (this prevents
  reordering code)

There may be other restrictions that I can't think of.  These are
pretty restrictive, but the Math code might satisfy them.  I haven't
looked.

Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]