Writing from my phone so quickly. Fastutil has both boxed and unboxed iterators. It also supports most of the things you have requested of HPPC so I would reconsider choosing it. Dawid
To unsubscribe from this group and stop receiving emails from it, send an email to java-high-performance-primi...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> Well, I said that the drawback of Iterators is that they are dynamically
> allocated, i.e every time you need to iterate a given container a new
> instance needs to be created.
I didn't check but I'm pretty sure you can expose the internals by
subclassing and exposing protected stuff from there. Anyway, whatever
suits you best of course :)
> Another idea I got while seeing implementation of clear(), is the
> possibility of using batch blanking using System.arraycopy() instead of
> Arrays.fill() to reset values (especially if sizes are power of 2!) in order
> [snip]
> Alas, not everybody is using Oracle JVM, or even JITing.
What do you mean by batch blanking? In general even if .fill is not an
intrinsic then it'll be jitted into pretty darn fast code -- bounds
checking will be eliminated, loop unrolled, etc. I really don't worry
much about people who cannot run a fairly recent (and decent)
implementation of the JVM -- for those special needs you'll have to
cater in special ways anyway (most of the time) by writing
JVM-specific (or device-specific) code. If you're stuck with such an
environment, your bad luck. Fork and tweak what you need.
All this said, any improvements are welcome, Vincent. Thanks for your
efforts. Even if they stay on a fork/ branch these things are still
out there for future reference (if somebody comes along and asks for
them) and will be credited to you appropriately.
Can you tell what exactly you're using? Just curious -- if this cannot
be disclosed, fine.
> For the "blanking", it means using a preallocated array representing
> "nulls", and using System.arraycopy() to overwrite the destination.
I checked and it seems array.fill is not an intrinsic. It probably
isn't because it jits and inlines so well so they didn't consider it
crucial. We could do partial-memcpy but I think this is an overkill,
to be honest. I'll benchmark it to make sure.