ArrayList<Long> is very costly, partly because of its remove operation but MOSTLY because it's going to be boxing and unboxing Long<-->long, which is *extremely* expensive and shouldn't have been permitted in the language in the first place. Here's my quick shot at LongBag, modified from DoubleBag and IntBag. Dunno if it works right but it probably does.
On Sep 24, 2016, at 3:55 AM, Axel Kowald <[log in to unmask]> wrote:
> Hello Everybody,
> I would need a Bag for "long" values.
> But since there is no LongBag I wonder if it is worthwhile to implement
> such a class in MASON or if I should simply use ArrayList<Long> ? I'm
> mainly concerned about speed. I often have to remove values and I wonder
> if (the destructive remove() of) a Bag is faster ??
> Any recommendations?