commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning Schmiedehausen <...@intermeta.de>
Subject Re: [LANG] Bugzilla id 17882
Date Mon, 17 Mar 2003 16:57:27 GMT
On Fri, 2003-03-14 at 19:00, Alex Chaffee / Purple Technology wrote:
> On Fri, Mar 14, 2003 at 12:34:56PM +0000, Henning P. Schmiedehausen wrote:
> > Henri Yandell <bayard@generationjava.com> writes:
> > 
> > >Is there any reason why split/join are special?
> > 
> > I need them. :-) And splitting at a single char / joining with a
> > single char as delimiter is needed very often and using '.' is more
> > efficient than "."
> 
> I believe you, but I prefer clean interfaces to performance
> optimizations.  If you run a quick performance test -- compare
> splitting and joining, say, a 10-item and a 10000-item list both by
> char and by String -- and post the results (or add them to the bug
> report) it might help make your case.


Without my patch:

What				10 items	10.000 item	100.000 item
Iterations			10000		100		100

join(Object[], String sep)	91 millis	478 millis	13939 millis
join(Iterator, String sep)	87 millis	977 millis	27737 millis
join(Object[], null)		44 millis	518 millis	13628 millis
join(Iterator, null)		74 millis	935 millis	22989 millis

With my patch:

What				10 items	10.000 item	100.000 item
Iterations			10000		100		100

join(Object[], String sep)	92 millis	480 millis	13801 millis
join(Iterator, String sep)	87 millis	981 millis	27774 millis
join(Object[], char sep)	40 millis	387 millis	13070 millis
join(Iterator, char sep)	71 millis	931 millis	27114 millis
join(Object[], null)		33 millis	337 millis	12498 millis
join(Iterator, null)		61 millis	800 millis	21756 millis

So the "char" operations are quite a bit faster especially with short array
lengths. The join operation with null separator has been speeded up quite a
bit (and concatenate() does map now on this).

So please, apply the patch. :-)

Test suite attached.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

Mime
View raw message