[thelist] Re: VBScript strings (was Re: DBA survey)

Filip Salomonsson filip at netdesign.se
Sun Mar 11 11:40:34 CST 2001


Matt Warden:
> Ok. Well it seemed like you were taking a general rule and making it a
> hard-fast law. I searched through my deleted items folder for your post to
> re-read it, but for some reason I couldn't find it *shrug*. Maybe
> I read it wrong, but it seemed like you saying that concatenation was
> always worse than multiple response.writes.

If "always" means "in all reasonable real-life scenarios", then that's
exactly what I meant.

> response.write "a" & "b" & "c"
>
> response.write "a"
> response.write "b"
> response.write "c"
>
> Now, I'm not going to claim to have personally done speed tests
> on this, but I would be quite surprised if the first one is slower
> than the second.

That's not the sort of concatenation I was referring to (since there is no
new variable space being allocated as with 'strHTML = strHTML & "more
html"'), but still...

..I tested this on the two machines I had available (quick tests, nothing
scientific). One is a workstation running Windows 2000 professional and
IIS5, and the other one is an NT 4 Server, with IIS4.
IIS4 handled the first example a few percent faster than the second, but on
IIS5 it was the other way around, and the difference between them was about
five times as big. It is, of course, highly dependent on the length of the
strings involved, and I don't have any detailed stats on when things turn.
Perhaps I'll look into it, and post the results here if anyone's interested.

> However, I do agree that a performance hit is incurred when the
> entire page is put into a variable and then printed out. But this,
> again, shouldn't discourage people from caching HTML items or
> even pages into Application variables.

Abolutely.

/filip





More information about the thelist mailing list