Guest
-
Total Posts
:
888
-
Reward points
:
0
- Joined: May 23 '01
-
Status: online
|
A general question about asp
Wed. Mar 27, '02 4:30 PM
( permalink)
I ran your demo and found a lot of <%=%> in your code. don' t you think it is going to slow down the script (context switching)? as far as I know, if you replace them with response.write it will be faster. what do you think?
|
|
|
|
Samuel
-
Total Posts
:
11786
-
Reward points
:
168350
- Joined: May 23 '01
-
Status: offline
|
RE: A general question about asp
Wed. Mar 27, '02 4:38 PM
( permalink)
ORIGINAL: Guest I ran your demo and found a lot of <%=%> in your code. don' t you think it is going to slow down the script (context switching)? as far as I know, if you replace them with response.write it will be faster. This is a myth about ASP. ASP actually runs faster with <%=%> because during compilation time asp.dll performs an optimization for the HTML outside of the context with its response.writeblock method. It references those interspersed HTML codes with ordinal, e.g response.writeblock(1) and this makes the HTML code output faster than the response.write method. with response.write asp.dll doesn' t know if the content that is gonna be written is ASP scripts or pure string, and thus slower. hope this answer ur question.
|
|
|
|
Guest
-
Total Posts
:
888
-
Reward points
:
0
- Joined: May 23 '01
-
Status: online
|
RE: A general question about asp
Wed. Mar 27, '02 4:58 PM
( permalink)
so you mean the more u use <%=%> the faster the script? I don' t quite understand what you meant by the write block method. At least I don' t see anyone mention it.
|
|
|
|
Samuel
-
Total Posts
:
11786
-
Reward points
:
168350
- Joined: May 23 '01
-
Status: offline
|
RE: RE: A general question about asp
Wed. Mar 27, '02 7:13 PM
( permalink)
no, it shouldn' t be intepreted like that. you should write you code so that you can read easily. There is no need to alter you existing code just because you now know <%=%> is faster, or response.write is slower. you should adhere to what you have been doing. keep the code easy to read for yourself, because you won' t notice at all the performance gain or loss converting your code from one to the other format. It might be 0.005 sec faster, but why bother changing you code for that 0.005 sec?
|
|
|
|