You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2013/11/06 02:39:34 UTC

I need a map for long and double

Hi All:

I'm looking for a Map implementation that takes a String as a key and a
long as the value (and another taking a double as the value). I'd rather
not take the extra memory of using generic map with a Long object value hit
since the maps will have up to 150,000 entries. That would save me... a meg
for each map I am guestimating (on a 64-bit JVM). A meg here, a meg there...

I did not see anything in [collections] or Google Guava.

Thoughts?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: I need a map for long and double

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Nov 6, 2013 at 2:19 AM, Emmanuel Bourg <eb...@apache.org> wrote:

> What about our own dog food?
>
> http://commons.apache.org/primitives/
>

No maps, no generics :(

Gary


>
> Emmanuel
>
>
> Le 06/11/2013 02:39, Gary Gregory a écrit :
> > Hi All:
> >
> > I'm looking for a Map implementation that takes a String as a key and a
> > long as the value (and another taking a double as the value). I'd rather
> > not take the extra memory of using generic map with a Long object value
> hit
> > since the maps will have up to 150,000 entries. That would save me... a
> meg
> > for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> there...
> >
> > I did not see anything in [collections] or Google Guava.
> >
> > Thoughts?
> >
> > Gary
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: I need a map for long and double

Posted by Emmanuel Bourg <eb...@apache.org>.
What about our own dog food?

http://commons.apache.org/primitives/

Emmanuel


Le 06/11/2013 02:39, Gary Gregory a écrit :
> Hi All:
> 
> I'm looking for a Map implementation that takes a String as a key and a
> long as the value (and another taking a double as the value). I'd rather
> not take the extra memory of using generic map with a Long object value hit
> since the maps will have up to 150,000 entries. That would save me... a meg
> for each map I am guestimating (on a 64-bit JVM). A meg here, a meg there...
> 
> I did not see anything in [collections] or Google Guava.
> 
> Thoughts?
> 
> Gary
> 


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


Re: I need a map for long and double

Posted by Paul Benedict <pb...@apache.org>.
I don't think anything like that exists. If your # of entries were
reasonable, a theoretical implementation could allocate a big long[] array
and hash into that. However, 150,000 is very large for an array; possible
but I never done it. So I think the only thing you can really rely on is
the standard Map<String, Value>


On Tue, Nov 5, 2013 at 7:39 PM, Gary Gregory <ga...@gmail.com> wrote:

> Hi All:
>
> I'm looking for a Map implementation that takes a String as a key and a
> long as the value (and another taking a double as the value). I'd rather
> not take the extra memory of using generic map with a Long object value hit
> since the maps will have up to 150,000 entries. That would save me... a meg
> for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> there...
>
> I did not see anything in [collections] or Google Guava.
>
> Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Cheers,
Paul

Re: I need a map for long and double

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Nov 6, 2013 at 12:47 PM, Ted Dunning <te...@gmail.com> wrote:

> Serialization of primitive maps is easy to implement since the maps pretty
> much just consist of a couple of arrays.  Most of the developers involved
> will shy away from java serialization or any dependency on some other
> framework.
>
> So is that really a show stopper?
>

Not at this time. I've actually taken Serialization IO out of the
picture/code for now. fastutil works, so now I need to step back and
consider whether to switch to HPPC.

Gary


>
>
>
> On Wed, Nov 6, 2013 at 6:11 AM, Gary Gregory <ga...@gmail.com>
> wrote:
>
> > On Tue, Nov 5, 2013 at 11:49 PM, Gary Gregory <garydgregory@gmail.com
> > >wrote:
> >
> > > Thank you all for replying.
> > >
> > > HPPC looks promising and it's Apache 2 licensed. I'll give it a closer
> > > look.
> > >
> >
> > HPPC does not allow for serialization and even says so, odd. Now looking
> at
> > fastutil...
> >
> > Gary
> >
> >
> > >
> > > Gary
> > >
> > >
> > > On Tue, Nov 5, 2013 at 8:59 PM, Ted Dunning <te...@gmail.com>
> > wrote:
> > >
> > >> Trove is GPL (last I looked).
> > >>
> > >> Mahout has primitive collection implementations (and is obviously
> ASL).
> > >>
> > >> There are other implementations such as hppc (see
> > >> http://labs.carrotsearch.com/hppc.html )
> > >>
> > >> Mahout is a decent implementation, but I think that hppc has had a
> round
> > >> or
> > >> two more optimization.
> > >>
> > >> And 150,000 entires in a table is not big for this sort of situation.
> > >>  Anything short of Integer.MAX_VALUE/small_factor should be fine.
> > >>
> > >>
> > >>
> > >>
> > >> On Tue, Nov 5, 2013 at 5:49 PM, Bruno P. Kinoshita <
> > >> brunodepaulak@yahoo.com.br> wrote:
> > >>
> > >> > Maybe Trove's TObjectMapLong?
> > >> >
> > >> > [1]
> > >> >
> > >>
> >
> http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html
> > >> >
> > >> >
> > >> > HTH,
> > >> >
> > >> > Bruno P. Kinoshita
> > >> > http://kinoshita.eti.br
> > >> > http://tupilabs.com
> > >> >
> > >> >
> > >> > >________________________________
> > >> > > From: Gary Gregory <ga...@gmail.com>
> > >> > >To: Commons Developers List <de...@commons.apache.org>
> > >> > >Sent: Tuesday, November 5, 2013 11:39 PM
> > >> > >Subject: I need a map for long and double
> > >> > >
> > >> > >
> > >> > >Hi All:
> > >> > >
> > >> > >I'm looking for a Map implementation that takes a String as a key
> > and a
> > >> > >long as the value (and another taking a double as the value). I'd
> > >> rather
> > >> > >not take the extra memory of using generic map with a Long object
> > value
> > >> > hit
> > >> > >since the maps will have up to 150,000 entries. That would save
> > me... a
> > >> > meg
> > >> > >for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> > >> > there...
> > >> > >
> > >> > >I did not see anything in [collections] or Google Guava.
> > >> > >
> > >> > >Thoughts?
> > >> > >
> > >> > >Gary
> > >> > >
> > >> > >--
> > >> > >E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > >> > >Java Persistence with Hibernate, Second Edition<
> > >> > http://www.manning.com/bauer3/>
> > >> > >JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > >> > >Spring Batch in Action <http://www.manning.com/templier/>
> > >> > >Blog: http://garygregory.wordpress.com
> > >> > >Home: http://garygregory.com/
> > >> > >Tweet! http://twitter.com/GaryGregory
> > >> > >
> > >> > >
> > >> > >
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > > Java Persistence with Hibernate, Second Edition<
> > http://www.manning.com/bauer3/>
> > > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > > Spring Batch in Action <http://www.manning.com/templier/>
> > >
> > > Blog: http://garygregory.wordpress.com
> > > Home: http://garygregory.com/
> > > Tweet! http://twitter.com/GaryGregory
> > >
> >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > Java Persistence with Hibernate, Second Edition<
> > http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: I need a map for long and double

Posted by Ted Dunning <te...@gmail.com>.
Serialization of primitive maps is easy to implement since the maps pretty
much just consist of a couple of arrays.  Most of the developers involved
will shy away from java serialization or any dependency on some other
framework.

So is that really a show stopper?



On Wed, Nov 6, 2013 at 6:11 AM, Gary Gregory <ga...@gmail.com> wrote:

> On Tue, Nov 5, 2013 at 11:49 PM, Gary Gregory <garydgregory@gmail.com
> >wrote:
>
> > Thank you all for replying.
> >
> > HPPC looks promising and it's Apache 2 licensed. I'll give it a closer
> > look.
> >
>
> HPPC does not allow for serialization and even says so, odd. Now looking at
> fastutil...
>
> Gary
>
>
> >
> > Gary
> >
> >
> > On Tue, Nov 5, 2013 at 8:59 PM, Ted Dunning <te...@gmail.com>
> wrote:
> >
> >> Trove is GPL (last I looked).
> >>
> >> Mahout has primitive collection implementations (and is obviously ASL).
> >>
> >> There are other implementations such as hppc (see
> >> http://labs.carrotsearch.com/hppc.html )
> >>
> >> Mahout is a decent implementation, but I think that hppc has had a round
> >> or
> >> two more optimization.
> >>
> >> And 150,000 entires in a table is not big for this sort of situation.
> >>  Anything short of Integer.MAX_VALUE/small_factor should be fine.
> >>
> >>
> >>
> >>
> >> On Tue, Nov 5, 2013 at 5:49 PM, Bruno P. Kinoshita <
> >> brunodepaulak@yahoo.com.br> wrote:
> >>
> >> > Maybe Trove's TObjectMapLong?
> >> >
> >> > [1]
> >> >
> >>
> http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html
> >> >
> >> >
> >> > HTH,
> >> >
> >> > Bruno P. Kinoshita
> >> > http://kinoshita.eti.br
> >> > http://tupilabs.com
> >> >
> >> >
> >> > >________________________________
> >> > > From: Gary Gregory <ga...@gmail.com>
> >> > >To: Commons Developers List <de...@commons.apache.org>
> >> > >Sent: Tuesday, November 5, 2013 11:39 PM
> >> > >Subject: I need a map for long and double
> >> > >
> >> > >
> >> > >Hi All:
> >> > >
> >> > >I'm looking for a Map implementation that takes a String as a key
> and a
> >> > >long as the value (and another taking a double as the value). I'd
> >> rather
> >> > >not take the extra memory of using generic map with a Long object
> value
> >> > hit
> >> > >since the maps will have up to 150,000 entries. That would save
> me... a
> >> > meg
> >> > >for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> >> > there...
> >> > >
> >> > >I did not see anything in [collections] or Google Guava.
> >> > >
> >> > >Thoughts?
> >> > >
> >> > >Gary
> >> > >
> >> > >--
> >> > >E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >> > >Java Persistence with Hibernate, Second Edition<
> >> > http://www.manning.com/bauer3/>
> >> > >JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> >> > >Spring Batch in Action <http://www.manning.com/templier/>
> >> > >Blog: http://garygregory.wordpress.com
> >> > >Home: http://garygregory.com/
> >> > >Tweet! http://twitter.com/GaryGregory
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> >
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>

Re: I need a map for long and double

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Nov 5, 2013 at 11:49 PM, Gary Gregory <ga...@gmail.com>wrote:

> Thank you all for replying.
>
> HPPC looks promising and it's Apache 2 licensed. I'll give it a closer
> look.
>

HPPC does not allow for serialization and even says so, odd. Now looking at
fastutil...

Gary


>
> Gary
>
>
> On Tue, Nov 5, 2013 at 8:59 PM, Ted Dunning <te...@gmail.com> wrote:
>
>> Trove is GPL (last I looked).
>>
>> Mahout has primitive collection implementations (and is obviously ASL).
>>
>> There are other implementations such as hppc (see
>> http://labs.carrotsearch.com/hppc.html )
>>
>> Mahout is a decent implementation, but I think that hppc has had a round
>> or
>> two more optimization.
>>
>> And 150,000 entires in a table is not big for this sort of situation.
>>  Anything short of Integer.MAX_VALUE/small_factor should be fine.
>>
>>
>>
>>
>> On Tue, Nov 5, 2013 at 5:49 PM, Bruno P. Kinoshita <
>> brunodepaulak@yahoo.com.br> wrote:
>>
>> > Maybe Trove's TObjectMapLong?
>> >
>> > [1]
>> >
>> http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html
>> >
>> >
>> > HTH,
>> >
>> > Bruno P. Kinoshita
>> > http://kinoshita.eti.br
>> > http://tupilabs.com
>> >
>> >
>> > >________________________________
>> > > From: Gary Gregory <ga...@gmail.com>
>> > >To: Commons Developers List <de...@commons.apache.org>
>> > >Sent: Tuesday, November 5, 2013 11:39 PM
>> > >Subject: I need a map for long and double
>> > >
>> > >
>> > >Hi All:
>> > >
>> > >I'm looking for a Map implementation that takes a String as a key and a
>> > >long as the value (and another taking a double as the value). I'd
>> rather
>> > >not take the extra memory of using generic map with a Long object value
>> > hit
>> > >since the maps will have up to 150,000 entries. That would save me... a
>> > meg
>> > >for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
>> > there...
>> > >
>> > >I did not see anything in [collections] or Google Guava.
>> > >
>> > >Thoughts?
>> > >
>> > >Gary
>> > >
>> > >--
>> > >E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> > >Java Persistence with Hibernate, Second Edition<
>> > http://www.manning.com/bauer3/>
>> > >JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> > >Spring Batch in Action <http://www.manning.com/templier/>
>> > >Blog: http://garygregory.wordpress.com
>> > >Home: http://garygregory.com/
>> > >Tweet! http://twitter.com/GaryGregory
>> > >
>> > >
>> > >
>> >
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: I need a map for long and double

Posted by Paul Benedict <pb...@apache.org>.
Same here. I didn't know this existed. Thanks.


On Tue, Nov 5, 2013 at 10:49 PM, Gary Gregory <ga...@gmail.com>wrote:

> Thank you all for replying.
>
> HPPC looks promising and it's Apache 2 licensed. I'll give it a closer
> look.
>
> Gary
>
>
> On Tue, Nov 5, 2013 at 8:59 PM, Ted Dunning <te...@gmail.com> wrote:
>
> > Trove is GPL (last I looked).
> >
> > Mahout has primitive collection implementations (and is obviously ASL).
> >
> > There are other implementations such as hppc (see
> > http://labs.carrotsearch.com/hppc.html )
> >
> > Mahout is a decent implementation, but I think that hppc has had a round
> or
> > two more optimization.
> >
> > And 150,000 entires in a table is not big for this sort of situation.
> >  Anything short of Integer.MAX_VALUE/small_factor should be fine.
> >
> >
> >
> >
> > On Tue, Nov 5, 2013 at 5:49 PM, Bruno P. Kinoshita <
> > brunodepaulak@yahoo.com.br> wrote:
> >
> > > Maybe Trove's TObjectMapLong?
> > >
> > > [1]
> > >
> >
> http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html
> > >
> > >
> > > HTH,
> > >
> > > Bruno P. Kinoshita
> > > http://kinoshita.eti.br
> > > http://tupilabs.com
> > >
> > >
> > > >________________________________
> > > > From: Gary Gregory <ga...@gmail.com>
> > > >To: Commons Developers List <de...@commons.apache.org>
> > > >Sent: Tuesday, November 5, 2013 11:39 PM
> > > >Subject: I need a map for long and double
> > > >
> > > >
> > > >Hi All:
> > > >
> > > >I'm looking for a Map implementation that takes a String as a key and
> a
> > > >long as the value (and another taking a double as the value). I'd
> rather
> > > >not take the extra memory of using generic map with a Long object
> value
> > > hit
> > > >since the maps will have up to 150,000 entries. That would save me...
> a
> > > meg
> > > >for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> > > there...
> > > >
> > > >I did not see anything in [collections] or Google Guava.
> > > >
> > > >Thoughts?
> > > >
> > > >Gary
> > > >
> > > >--
> > > >E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > > >Java Persistence with Hibernate, Second Edition<
> > > http://www.manning.com/bauer3/>
> > > >JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > > >Spring Batch in Action <http://www.manning.com/templier/>
> > > >Blog: http://garygregory.wordpress.com
> > > >Home: http://garygregory.com/
> > > >Tweet! http://twitter.com/GaryGregory
> > > >
> > > >
> > > >
> > >
> >
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Cheers,
Paul

Re: I need a map for long and double

Posted by Gary Gregory <ga...@gmail.com>.
Thank you all for replying.

HPPC looks promising and it's Apache 2 licensed. I'll give it a closer look.

Gary


On Tue, Nov 5, 2013 at 8:59 PM, Ted Dunning <te...@gmail.com> wrote:

> Trove is GPL (last I looked).
>
> Mahout has primitive collection implementations (and is obviously ASL).
>
> There are other implementations such as hppc (see
> http://labs.carrotsearch.com/hppc.html )
>
> Mahout is a decent implementation, but I think that hppc has had a round or
> two more optimization.
>
> And 150,000 entires in a table is not big for this sort of situation.
>  Anything short of Integer.MAX_VALUE/small_factor should be fine.
>
>
>
>
> On Tue, Nov 5, 2013 at 5:49 PM, Bruno P. Kinoshita <
> brunodepaulak@yahoo.com.br> wrote:
>
> > Maybe Trove's TObjectMapLong?
> >
> > [1]
> >
> http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html
> >
> >
> > HTH,
> >
> > Bruno P. Kinoshita
> > http://kinoshita.eti.br
> > http://tupilabs.com
> >
> >
> > >________________________________
> > > From: Gary Gregory <ga...@gmail.com>
> > >To: Commons Developers List <de...@commons.apache.org>
> > >Sent: Tuesday, November 5, 2013 11:39 PM
> > >Subject: I need a map for long and double
> > >
> > >
> > >Hi All:
> > >
> > >I'm looking for a Map implementation that takes a String as a key and a
> > >long as the value (and another taking a double as the value). I'd rather
> > >not take the extra memory of using generic map with a Long object value
> > hit
> > >since the maps will have up to 150,000 entries. That would save me... a
> > meg
> > >for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> > there...
> > >
> > >I did not see anything in [collections] or Google Guava.
> > >
> > >Thoughts?
> > >
> > >Gary
> > >
> > >--
> > >E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > >Java Persistence with Hibernate, Second Edition<
> > http://www.manning.com/bauer3/>
> > >JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > >Spring Batch in Action <http://www.manning.com/templier/>
> > >Blog: http://garygregory.wordpress.com
> > >Home: http://garygregory.com/
> > >Tweet! http://twitter.com/GaryGregory
> > >
> > >
> > >
> >
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: I need a map for long and double

Posted by Ted Dunning <te...@gmail.com>.
Trove is GPL (last I looked).

Mahout has primitive collection implementations (and is obviously ASL).

There are other implementations such as hppc (see
http://labs.carrotsearch.com/hppc.html )

Mahout is a decent implementation, but I think that hppc has had a round or
two more optimization.

And 150,000 entires in a table is not big for this sort of situation.
 Anything short of Integer.MAX_VALUE/small_factor should be fine.




On Tue, Nov 5, 2013 at 5:49 PM, Bruno P. Kinoshita <
brunodepaulak@yahoo.com.br> wrote:

> Maybe Trove's TObjectMapLong?
>
> [1]
> http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html
>
>
> HTH,
>
> Bruno P. Kinoshita
> http://kinoshita.eti.br
> http://tupilabs.com
>
>
> >________________________________
> > From: Gary Gregory <ga...@gmail.com>
> >To: Commons Developers List <de...@commons.apache.org>
> >Sent: Tuesday, November 5, 2013 11:39 PM
> >Subject: I need a map for long and double
> >
> >
> >Hi All:
> >
> >I'm looking for a Map implementation that takes a String as a key and a
> >long as the value (and another taking a double as the value). I'd rather
> >not take the extra memory of using generic map with a Long object value
> hit
> >since the maps will have up to 150,000 entries. That would save me... a
> meg
> >for each map I am guestimating (on a 64-bit JVM). A meg here, a meg
> there...
> >
> >I did not see anything in [collections] or Google Guava.
> >
> >Thoughts?
> >
> >Gary
> >
> >--
> >E-Mail: garydgregory@gmail.com | ggregory@apache.org
> >Java Persistence with Hibernate, Second Edition<
> http://www.manning.com/bauer3/>
> >JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> >Spring Batch in Action <http://www.manning.com/templier/>
> >Blog: http://garygregory.wordpress.com
> >Home: http://garygregory.com/
> >Tweet! http://twitter.com/GaryGregory
> >
> >
> >
>

Re: I need a map for long and double

Posted by "Bruno P. Kinoshita" <br...@yahoo.com.br>.
Maybe Trove's TObjectMapLong? 

[1] http://trove4j.sourceforge.net/javadocs/gnu/trove/map/TObjectLongMap.html

 
HTH, 

Bruno P. Kinoshita
http://kinoshita.eti.br
http://tupilabs.com


>________________________________
> From: Gary Gregory <ga...@gmail.com>
>To: Commons Developers List <de...@commons.apache.org> 
>Sent: Tuesday, November 5, 2013 11:39 PM
>Subject: I need a map for long and double
> 
>
>Hi All:
>
>I'm looking for a Map implementation that takes a String as a key and a
>long as the value (and another taking a double as the value). I'd rather
>not take the extra memory of using generic map with a Long object value hit
>since the maps will have up to 150,000 entries. That would save me... a meg
>for each map I am guestimating (on a 64-bit JVM). A meg here, a meg there...
>
>I did not see anything in [collections] or Google Guava.
>
>Thoughts?
>
>Gary
>
>-- 
>E-Mail: garydgregory@gmail.com | ggregory@apache.org
>Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
>JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>Spring Batch in Action <http://www.manning.com/templier/>
>Blog: http://garygregory.wordpress.com
>Home: http://garygregory.com/
>Tweet! http://twitter.com/GaryGregory
>
>
>