You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Xeno Amess <xe...@gmail.com> on 2019/06/07 19:53:37 UTC

Is there some plans for implementing some primitive datas tructures?

Recently I feel like sometimes ArrayList<Integer> or HashSet<Integer> is
just...too slow.
If we implement the datas tructures in primitive types and offer some
functions to fit the common interfaces, I really think that can help.
Sorry for my poor english, but you can get what I mean at
https://github.com/XenoAmess/commonx/tree/master/src/main/java/com/xenoamess/commons/collections/list/primitive_array_lists


*LongArrayList score : 12399758ArrayList<Long> score : 27851927*

According to the test result, sometimes it will run more than 1 times
faster when we use primitive such data structures...
I just wonder:
1.  Is this thing done by some libraries before?
2. Are there any guys who are as interested with such things as me? (as I
don't think I can fo this translation of codes completely by myself.)
3. If 1->false , then will there be any possibility that apache do such
things?(either clean room implementations or translation?)
Thx..
-----XenoAmess.

Re: Is there some plans for implementing some primitive datas tructures?

Posted by Pascal Schumacher <pa...@gmx.net>.
Am 07.06.2019 um 21:53 schrieb Xeno Amess:
> 1.  Is this thing done by some libraries before?
Not Apache, but two popular open collection libraries offering primitive
collections are trove4j (https://bitbucket.org/trove4j) and Eclipse
Collections (https://www.eclipse.org/collections/).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Is there some plans for implementing some primitive datas tructures?

Posted by Alex Herbert <al...@gmail.com>.
Have a look at GNU Trove:

http://trove4j.sourceforge.net/html/overview.html <http://trove4j.sourceforge.net/html/overview.html>

https://bitbucket.org/trove4j/trove/src/master/ <https://bitbucket.org/trove4j/trove/src/master/>

It offers hash maps and array collections for all primitives.

The stable version 3.0.3 is from 2012 and I’ve used this without any issue for years.

I do not know about recent development. It is on maven as this artefact.

https://search.maven.org/search?q=g:net.sf.trove4j <https://search.maven.org/search?q=g:net.sf.trove4j>



> On 7 Jun 2019, at 20:53, Xeno Amess <xe...@gmail.com> wrote:
> 
> Recently I feel like sometimes ArrayList<Integer> or HashSet<Integer> is
> just...too slow.
> If we implement the datas tructures in primitive types and offer some
> functions to fit the common interfaces, I really think that can help.
> Sorry for my poor english, but you can get what I mean at
> https://github.com/XenoAmess/commonx/tree/master/src/main/java/com/xenoamess/commons/collections/list/primitive_array_lists
> 
> 
> *LongArrayList score : 12399758ArrayList<Long> score : 27851927*
> 
> According to the test result, sometimes it will run more than 1 times
> faster when we use primitive such data structures...
> I just wonder:
> 1.  Is this thing done by some libraries before?
> 2. Are there any guys who are as interested with such things as me? (as I
> don't think I can fo this translation of codes completely by myself.)
> 3. If 1->false , then will there be any possibility that apache do such
> things?(either clean room implementations or translation?)
> Thx..
> -----XenoAmess.