Re: Built-ins for hashes - keys, values and entries?

Randall R Schulz <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
On Friday 13 June 2008 08:42, Zemian Deng wrote:
> Hi list,
>
> Is there a reason not to add a "entries" to hashes built-in that's
> similar to java.util.Map#entrySet?
>
> AFAIK, looping over java.util.Map via entry set is much faster than
> looping a key set then retrieve value by each key on all items.

For what it's worth, that may be true of Sun's implementation of a 
hashed map, but Trove4J's implementation is the opposite, since it does 
not use the memory-wasting chained-buckets technique.

I guess the point is that low-level performance considerations like this 
are incidental, not intrinsic.


> -Zemian


Randall Schulz

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.