Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27525
| From | Jan Burse <janburse@fastmail.fm> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: java8 up to 6x slower than java7 |
| Date | 2014-02-16 14:38 +0100 |
| Organization | albasani.net |
| Message-ID | <ldqf11$adv$1@news.albasani.net> (permalink) |
| References | <29a51a94-8f9a-41b1-980f-e8c13e2d11a2@googlegroups.com> <ldnitt$mtv$1@news.albasani.net> <ldnkf1$pp0$1@news.albasani.net> <bmbo69F4b27U1@mid.individual.net> |
Robert Klemme schrieb:
> Also, the article does not mention that the fill factor limits the
> average length of the chain used for linear probing.
Yes, that is also my idea. I guess the problem is bound
to bad hashing in the objects that are used as keys, or
hashing that remains konstant even when the fill factor
changes.
I wonder why the web server or any of the business cases
that need that improvement do not implement a combination
uf HashMap and TreeMap by themselfs, so as to leave the
HashMap a more primitive construct.
The source code of the new HashMap is found in the
early access distribution of JDK 8. It seems that
they use a constant threshold:
static final int MIN_TREEIFY_CAPACITY = 64;
And then there is a lot of copying and creating new
objects going on:
final void treeify(Node<K,V>[] tab) {
And the tree seems to be sorted first by the hash
and by compareTo(). Whereby they use reflection to
figure out whether one of the objects implements the
generic interface.
I guess the above can lead to performance degradation,
especially in border cases, for example when one
unitentionally runs into the treeification but then
doesn't make much use of it.
Maybe for non border cases, the new HashMap is ok,
probably a bigger memory foot print. I made some
application tests over the last days. 1 use case is
faster, and 2 use cases are slower.
For the slower use cases I am planing using my custom
HashMap. The custom HashMap has some further advantages
besides sparing the iterator, I also don't do mod
counting.
One trick to develop a custom HashMap is to use the
JDK source code, and create a stripped down variant.
Not sure whether copyright allows this really. So I
didn't mention that here.
Bye
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
java8 up to 6x slower than java7 Dennis Haupt <d.haupt82@gmail.com> - 2014-02-15 03:00 -0800
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-15 12:26 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-15 12:28 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-15 12:52 +0100
Re: java8 up to 6x slower than java7 Robert Klemme <shortcutter@googlemail.com> - 2014-02-16 13:10 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-16 14:38 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-16 14:43 +0100
Re: java8 up to 6x slower than java7 Robert Klemme <shortcutter@googlemail.com> - 2014-02-16 14:53 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-16 20:27 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-02-16 20:36 +0100
Re: java8 up to 6x slower than java7 Robert Klemme <shortcutter@googlemail.com> - 2014-02-17 18:55 +0100
Re: java8 up to 6x slower than java7 Wanja Gayk <brixomatic@yahoo.com> - 2014-03-02 20:52 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-03-03 11:53 +0100
Re: java8 up to 6x slower than java7 Joerg Meier <joergmmeier@arcor.de> - 2014-03-03 17:16 +0100
Re: java8 up to 6x slower than java7 Jan Burse <janburse@fastmail.fm> - 2014-03-03 19:53 +0100
Re: java8 up to 6x slower than java7 Lew <lewbloch@gmail.com> - 2014-03-03 13:44 -0800
Re: java8 up to 6x slower than java7 Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2014-02-16 11:24 -0800
Re: java8 up to 6x slower than java7 Robert Klemme <shortcutter@googlemail.com> - 2014-02-15 12:55 +0100
Re: java8 up to 6x slower than java7 "Qu0ll" <Qu0llSixFour@gmail.com> - 2014-02-15 23:42 +1100
Re: java8 up to 6x slower than java7 Roedy Green <see_website@mindprod.com.invalid> - 2014-02-16 00:25 -0800
csiph-web