commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Chaffee / Purple Technology <g...@stinky.com>
Subject Re: [LANG] Bugzilla id 17882
Date Mon, 17 Mar 2003 22:20:20 GMT
Henning -

Thanks for taking the time to run this experiment!  

If I read your results right, there is almost no difference in large
lists, and a ~50% speedup in short lists.

> What				10 items	10.000 item	100.000 item
> Iterations			10000		100		100
> 
> join(Object[], String sep)	92 millis	480 millis	13801 millis
> join(Object[], char sep)	40 millis	387 millis	13070 millis

Speedup:                        57%                19%             5%

Also, you ran many (100 times) more iterations in the 10-item case
than the 10000-item case.  Looking at the code, it seems like this is
fair, but we may need to refute the possibility that the 50-msec
difference was due to string initialization or garbage collection
happening more often...  Is that right?  Or am I just being paranoid?

> So please, apply the patch. :-)
> 

Since I just joined as a committer here, I don't feel like it's my
call, but I'm still leaning towards API simplicity for StringUtils,
especially since anyone who wants to shave a few msec off a tight loop
can inline our source code and change the type of the parameter from
String to char themselves.

Did the patch change anything other than the parameter type?  It
doesn't seem so from glancing at the diff.

-0 for me for now, unless convinced otherwise.

 - A

-- 
Alex Chaffee                               mailto:alex@jguru.com
Purple Technology - Code and Consulting    http://www.purpletech.com/
jGuru - Java News and FAQs                 http://www.jguru.com/alex/
Gamelan - the Original Java site           http://www.gamelan.com/
Stinky - Art and Angst                     http://www.stinky.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message