commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Re: [LANG] Bugzilla id 17882
Date Mon, 17 Mar 2003 23:14:05 GMT
Alex Chaffee / Purple Technology <guru@stinky.com> writes:

>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?

I was just lazy. The 100 iterations took quite a while for the 100.000 items
run and reported things like "24 millis" for all the 10 item tests with
the setup overhead being so high that there was nothing much to measure. That's
why I ran the 10 item test much more often to get some visible numbers. I'd
say that the relative speedup of char vs. String is much more interesting
than the absolute numbers.

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

I added some micro optimization for the "separator == null" case to the
join(..., String) cases.

	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

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