Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24949

Re: java String split() does not work for delimiter "|" ?

From Michael Jung <miju@golem.phantasia.org>
Newsgroups comp.lang.java.programmer
Subject Re: java String split() does not work for delimiter "|" ?
Date 2013-08-11 11:12 +0200
Organization albasani.net
Message-ID <87vc3cvbeh.fsf@golem.phantasia.org> (permalink)
References (3 earlier) <mcmurtrie-CC0F7F.23463108082013@c-61-68-245-199.per.connect.net.au> <i61Nt.55783$Su6.15816@fx16.iad> <mcmurtrie-DE857C.23255209082013@c-61-68-245-199.per.connect.net.au> <874naxbzlo.fsf@golem.phantasia.org> <jRBNt.247964$Ln4.217537@fx24.iad>

Show all headers | View raw


Arved Sandstrom <asandstrom2@eastlink.ca> writes:
> On 08/10/2013 07:37 AM, Michael Jung wrote:
[...]
>> I can confirm that this does matter in business code. We got a 10%-20%
>> performance boost by avoiding split for certain use cases that used it a
>> lot, not just in micro-optimizing tests. The numbers from Kevin are
>> about what we had (although I personally wouldn't show that many decimal
>> places that suggest a higher degree of accuracy than is actually
>> reasonable).
> I don't doubt that use of String.split is not always the optimal
> approach. From the sounds of it it's not often the optimal
> approach. But I'll bet that the large majority of the time using it is
> a "good enough" approach, because very often that extra 10-20 percent
> speed bump isn't actually needed.
[...]
> But I wouldn't eschew String.split as a rule. I doubt most apps care.

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).

Michael

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: java String split() does not work for delimiter "|" ? smarty.ad4@gmail.com - 2013-08-08 05:07 -0700
  Re: java String split() does not work for delimiter "|" ? Lew <lewbloch@gmail.com> - 2013-08-08 13:16 -0700
    Re: java String split() does not work for delimiter "|" ? Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-08-08 23:46 -0700
      Re: java String split() does not work for delimiter "|" ? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-08-09 04:45 -0300
        Re: java String split() does not work for delimiter "|" ? Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-08-09 23:25 -0700
          Re: java String split() does not work for delimiter "|" ? Michael Jung <miju@golem.phantasia.org> - 2013-08-10 12:37 +0200
            Re: java String split() does not work for delimiter "|" ? Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-08-10 22:33 -0300
              Re: java String split() does not work for delimiter "|" ? Michael Jung <miju@golem.phantasia.org> - 2013-08-11 11:12 +0200
                Re: java String split() does not work for delimiter "|" ? Joerg Meier <joergmmeier@arcor.de> - 2013-08-11 13:32 +0200
                Re: java String split() does not work for delimiter "|" ? Michael Jung <miju@golem.phantasia.org> - 2013-08-11 17:42 +0200
          Re: java String split() does not work for delimiter "|" ? Joerg Meier <joergmmeier@arcor.de> - 2013-08-10 15:34 +0200

csiph-web