Performance: float vs Float?

Viewed 156

I have to store a lot of float in an array. There should be gaps in the array in which no values are stored (at least temporary).

My solution is to make an array of the wrapper class Float and set the gaps to null. Its clear that this is slower than to deal with a float-array but there it is not possible to set to null.

Now my question: How big is the performance decrease (time and memory) when taking Float instead of float?

SOLUTION: Use float and set gaps to NaN with Float.NaN

Thanks for your answers!

0 Answers
Related