Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: java8 up to 6x slower than java7 Date: Sat, 15 Feb 2014 12:55:23 +0100 Lines: 25 Message-ID: References: <29a51a94-8f9a-41b1-980f-e8c13e2d11a2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net uTx0K8P7F6HdE+W8XCehqgSqLjNae7DU9wehd3DHe9LRSkT5s= Cancel-Lock: sha1:09igyKkxXtaGnfXW5OwrzU1Jxw8= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <29a51a94-8f9a-41b1-980f-e8c13e2d11a2@googlegroups.com> Xref: csiph.com comp.lang.java.programmer:27517 On 15.02.2014 12:00, Dennis Haupt wrote: > i wrote a little pathfinder. i can run it under the jdk7 update 51 > and it is done in ~20 seconds. under java8, since a long series of > builds, a certain part involving deeeeeeeeeep recursion takes ~60 > seconds instead of 10. i suspected the hashmap change of java8 to be > the culprit since i perform a lot of put operations, but that's not > it - i used the standard hashmap from scala to be 100% sure the > hashmap can't be the reason (or is), and indeed, i get the same > performance difference between java7 and 8 with the same hashmap my > profiler (yourkit) shows that java8 spends a much bigger amount of > time on garbage collection and allocated more objects. if i take a > memory snapshot, can see that the final results are equal, so i have > more temporary objects. yourkit also shows that more objects are > allocated using java8. what is up with that? all i do in the critical > method is creating arraylists and performing puts, contains and gets > on a hashmap, and the recursive call. the time is, according to > yourkit, spend in the method itself, not inside the hashmap or > arraylist constructor. any ideas? Does your profiler not show allocation hotspots? Other than that it's just wild speculation without seeing the code. Cheers robert