Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: Michael Jung Newsgroups: comp.lang.java.programmer Subject: Re: java String split() does not work for delimiter "|" ? Date: Sun, 11 Aug 2013 17:42:27 +0200 Organization: albasani.net Lines: 21 Message-ID: <87d2pkp730.fsf@golem.phantasia.org> References: <1192221546.937577.276350@t8g2000prg.googlegroups.com> <14c56553-a55c-4410-8a12-2ab215639d2e@googlegroups.com> <4c416073-9f99-425e-9954-d65fe2ad1a76@googlegroups.com> <874naxbzlo.fsf@golem.phantasia.org> <87vc3cvbeh.fsf@golem.phantasia.org> <1mlquf3u009yf$.1is9lpr7sfmme$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.albasani.net k9/FHOvxHwaWyyq7pxNg56D9DEwoibpXYJpMYRv4du/+NXRC++ITJLyogpR0FwcN1TsAHjPacHoD3fyeMQ/0qvZKP0cSg/+a4+F6tLQwnDoU2e/Lt6cW165P1WEP4PWT NNTP-Posting-Date: Sun, 11 Aug 2013 15:42:27 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="aCNstvnoFpMeM2++kzt+9Gng1MVCKarBbxj9ItzFQ5cSEH3V8y6OlFWwXiQAFgNeIsUFgq3DAsk4yYnj2NiuytdLCsfoW/snEgepdga60gxYyjS70ep8FdcwK450cEEZ"; mail-complaints-to="abuse@albasani.net" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:HsprXMIgt89OrbvoQ78xCqtgVmQ= sha1:PfS8gF2DV7xTKWqrBumdxbroC0Y= Xref: csiph.com comp.lang.java.programmer:24951 Joerg Meier writes: > On Sun, 11 Aug 2013 11:12:38 +0200, Michael Jung wrote: >> I use split myself often enough. You can read my response as a case for >> optimzation surprises. The micro benchmark shows around a 200% boost >> (3:10), the overall gain was 15%, but the code in question as to the >> amount of (user-level) code run through was far less than 1% (big "fat" >> EE application). > Well, odds are, not many applications spend 25% of their CPU time doing > .split(), so I would say that your application speeding up that much is an > extreme edge case. What on Earth do you do that requires millions of > .split() calls per second, and why did you think that would even remotely > be a representative example ? Odds are that the rest of the application was already highly optimized. (I already said this was for certain use cases.) Whether this is representative of something, I don't know, everybody has to judge for himself what to do with split. But string manipulation is omnipresent in many applications these days. This was just some light. Michael