getQuick is a real problem and usually very, very little performance
benefit.

I think that keeping it is important, but using is often not such a great
idea.  On reading new code, I would be quite suspicious of its use unless it
is completely obvious critical to performance.

Sean's suggestion that iterators be used instead is quite good.  Colt didn't
originally have good iterator patterns which is why getQuick was so
important to have (and use) back then.  Now that we have a more modern java,
we should strongly encourage the iterator style.

On Sun, May 23, 2010 at 3:47 PM, Sean Owen <[email protected]> wrote:

> I might hijack this to question the existence of getQuick(). It's for
> situations where the caller "knows" the dimension is in bounds, but
> perhaps it's too tempting to just call this even when that's not
> known. Here calling get() would have just resulted in a different and
> only slightly-better exception. In another implementation it might
> have silently failed by returning a zero or something though.
>
> One thought is to remove getQuick(). It has performance implications.
> Maybe many uses of getQuick() could be better constructed as
> iterations, I don't know.
>

Reply via email to