larray
larray copied to clipboard
Add Int-index API for LArray.
Long-based indexes has some performance overhead if no need exists to use buffers more than 2GB. We should provide LArray interface for int-based indexes.
The naming of this interface would be SArray or IArray.
LBuffer introduced apply(i:Int), update(i:Int, v:A) methods.
LIntArray etc. also needs to have these methods.
I've tested both API on a 64-bit computer with Windows and I don't see any conclusive difference. All the int pointers will be expanded to 64bits anyway, and memory has some alignment limitations as well - I'd there is pretty much no benefit of having int indexing here
@kosiakk Thanks for the update. My result was pretty old, so recent JVM might have some optimization around that.