|
Posted by NoWhereMan on 05/14/07 19:59
On Mon, 14 May 2007 22:14:58 +0300, Rami Elomaa wrote:
> Why don't you benchmark them for comparison? Run both in a loop for
> thousands of times and take time for both and check how much memory they
> consume. You'll need memory_get_usage(), maybe memory_get_peak_usage()
> and microtime().
unfortunately the PHP version I've got here has not been compiled with
memory limits... by the way, I've did this quick and dirty concat vs.
implode test with microtime() only.
concat is generally a bit slower than join when strings are small and
iterations are not many (for instance 10) results are about in the order of
8.5E-5 vs. 6.0E-5 so quite a bit :)
by the way as the number of iterations grows and as the length of the
string grows the results are very comparable, so comparable (almost same
values from 0.00025 to 0.00030) that I think loops must have been optimized
in this sense :)
bye
--
NoWhereMan (e.v.)
-- http://www.nowhereland.it
-- http://flatpress.nowhereland.it
Navigation:
[Reply to this message]
|