![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.javascript archiveRe: Javascript String Concatenations
From: Lasse Reichstein Nielsen <lrn@hotpop.com>
Date: Wed Nov 30 2005 - 21:42:11 CET
"web.dev" <web.dev.cs@gmail.com> writes:
> I would argue that test study is not conclusive. True, string
Why would it be slower than some other string of similar length?
> Have you considered other factors? The code is no doubt
Apart from the string contcatenation, there are nothing that really
> For example, it is using two for loops! That's a O(n^2).
Well, no. The table has COLS*ROWS cells. Whether in one loop or
> Don't forget the initialization of a for loop.
Yes, it has overhead, but it's negligable.
> Oh yeah, did you miss the post increment? Would be more efficient
You have absolutely no way of knowing that. The interpreter can easily
> Unless you have written an optimized code, that study does not
It doesn't really matter whether the surrounding code is optimized,
/L
-- Lasse Reichstein Nielsen - lrn@hotpop.com DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> 'Faith without judgement merely degrades the spirit divine.'Received on Sat Dec 3 04:33:58 2005 |