I donβt have much Java.
I am writing some optimized math code and I was shocked by the results of my profilers. My code collects the values, interleaves the data, and then selects the values ββbased on this. Java is slower than my C ++ and MATLAB implementations.
I am using javac 1.7.0_05 I am using Sun / Oracle JDK 1.7.05
There is a floor function that performs the corresponding task in code. 
- Does anyone know of a paradigmatic way to fix this?
I noticed that my floor() function is defined using StrictMath . Is there something like -ffast-math for Java? I expect that there should be a way to change the gender function to something more reasonably computational without writing my own.
public static double floor(double a) { return StrictMath.floor(a);
Edit
So, several people suggested I try to make a throw. I tried this, and there were no changes in the walls.
private static int flur(float dF) { return (int) dF; }
413742 cast floor function
394675 Math.floor
These tests were performed without a profiler. An effort was made to use the profiler, but the runtime was radically changed (15 minutes, so I left).
java performance profiling floor
Mikhail Aug 21 '12 at 6:18 2012-08-21 06:18
source share