Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Java 7 vs 8 speed issues on Win7? Date: Thu, 20 Nov 2014 19:06:17 +0100 Lines: 27 Message-ID: References: <546ddd8d$0$2902$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net +UiIRU21L0sqXQLOSt59VA8H+iOxPSI4oaXss1IgsCaR5UVAc= Cancel-Lock: sha1:FEizF21tEfSK+AfX9ihJwUCzGz0= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <546ddd8d$0$2902$e4fe514c@news.xs4all.nl> Xref: csiph.com comp.lang.java.programmer:30370 On 20.11.2014 13:24, Silvio wrote: > I am in the habit of writing lexers and parsers and I still curse the > day they decided to do this. If you want sharing semantics you can still do that by explicitly implementing this. I know, you have to do it which costs. > It was just a cheap way to save memory on > the String class because it allowed them to ditch the offset/length > members. It's not only that. I am pretty sure this also has to do with how garbage collectors evolved. Nowadays it is usually much cheaper to just create a bunch of short lived objects than trying to devise sophisticated schemes to save memory by reusing objects (which then will stay around for longer). And we all know that the longer an object lives the higher the GC cost on it because it has to be revisited over and over again. I am pretty confident that engineers at Sun / Oracle did sufficient research to warrant the change. As with every change some suffer. But I assume for the majority it is an improvement or at least not noticeable. Kind regards robert