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

[netCDFJava #SCH-111122]: Problem casting Array



> Something I must check : are 2D or 3D java array (what I actually use in 
> my program) significantly faster than the ucar Array (doing several 
> operations to get to the data, but data stored in 1D array) ? ...

This is the right question to ask. I tried to make Array as fast as possible, 
now we are just waiting for the compiler to make it as fast as native arrays. 
It needs to inline the index calculations, but the polymorphism was/is 
interfering in some cases.

The runtime compiler (JVM Hotspot) continues to get better at optimizing. But 
measuring this is not trivial, best to run on real problems, not 
microbenchmarks. We have seen that JDK 1.6 is faster than 1.5. If performance 
is most important, use 1D arrays and do your own index calculations. Otherwise 
Array is a good abstraction. Im not sure about 2D/3D arrays, but probably they 
are somewhat slower than 1D arrays, since there is more indirection and harder 
to optimize I assume.

Please let me know any measurements you make, i havent had to compare recently.

Bon chance!



Ticket Details
===================
Ticket ID: SCH-111122
Department: Support netCDF Java
Priority: Normal
Status: Open