Forum Moderators: open

Message Too Old, No Replies

ASP.Net Performance Issues

Why is it better than old ASP

         

IanTurner

10:09 pm on Sep 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I am currently mulling over in my mind alot of issues with ASP.Net and there seem to be some significant problems with performance. These are the two that spring immediately to mind.

1. ASP.Net seems to be slower than plain ASP for almost all activity. (Note: I never managed to use ASP in a standard way and never could work out exactly what use the global.asa file had either.)

2. ASP.Net form field controls just seem like a good way of destroying useful pages when related to SEO. (Assuming at this point that the .aspx page will almost certainly be penalised in comparison with a .htm page)

We have also had some problems in working a good solution to a global database connection, though I think we have this sorted now, much more complicated that the standard ASP solution though.

txbakers

3:47 pm on Oct 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Ian, I'm with you, I never truly figured out what the global.asa file was for either.

As for the slowness of .NET, each page has to be compiled before being converted to HTML so it will be a bit slower the first time a page is requested. After that it should actually be faster since the browser is reading a compiled class instead of having to reinterpret the script each time.

ASP.NET is a pretty good ripoff of JSP. JSP has the same lag when you first pull up the page, after which it's nice and speedy.

macrost

6:00 pm on Oct 4, 2003 (gmt 0)

10+ Year Member



Well I have never used the global.asa file yet, but here's an example (i might just implement this...) Say you cache an xml feed every hour, and you have code that will do it, say like my site. I have xml files cached, and when a user hits that page, it looks at the last modified date for that file on the server, then if it's greater than 1 hour, get the xml file and save it to disk again. Now i know there's going to be a performance issue when my unique users gets to hight, so in the global.asa file I can have Sub_SessionOnload and have the code there look at the file's date. I hope I have explained what's going on in my head well enough, but after all it is a Sat afternoon!

Mac

IanTurner

6:34 pm on Oct 4, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



As an example we have recently put together a .Net shopping cart as it was thought that this would be more reliable, and provide more functionality than our ASP cart. Okay there is more functionality however the performance is so bad I am now seriously looking at pulling it and putting the old ASP cart back because it is so slow I feel that I might lose customers.

This is even on return visits to the cart.

TheNige

1:44 am on Oct 14, 2003 (gmt 0)

10+ Year Member



I truely think that a lot of people do not know how to use ASP.Net to its fullest potential. You can't just code the same way that you did with classic ASP. It is really different....a lot better.

Using the caching features and the new data access methods and objects correctly, I have not noticed any slow executions, and for the most part I can create more powerful applications is a lot less time. ASP.Net is not "scripting" anymore.

[edited by: engine at 8:16 am (utc) on Oct. 14, 2003]
[edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit]

korkus2000

12:37 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ian are you using ADO.net? I am not sure why you are seeing a lag. ASP.net really blows old asp out of the water. I use to feel the same way you did until I really started learning the class library and ADO.net.

Global.asa is really just for stuff you want to fire when your application or sessions start. I use it for redirecting bad bots.

The server controls are good for some things, but I mostly use the regular html controls inside the htmlcontrols class instead of the WebControls class. You can run the regular controls at the server level but change what ever you need. You can also stop the submitting on every event fire.

I have also noted a performance issue using 2000 instead of 2003 server. You may want to look into unsafe code for your components. This allows you to take advantage of pointers and not rely on garbage collection.

Asp works fine for basic in and out of a database. .Net is really meant for full app development. Sometimes it just makes sense to use classic ASP. For a shopping cart though I would use .Net.

What language are you using Ian?

>>global database connection

do you just need the string? You should use your web.config, or more likely the machine.config for more security. If you want the connection open you can create an object to handle all of the database things.

IanTurner

5:24 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



We are using 2000 server, with the .Net extensions, which I think could be part of the problem.

Will look at the ADO.Net stuff and see if we can use it.

Development is in VB

TheNige

10:43 pm on Oct 14, 2003 (gmt 0)

10+ Year Member



You should really check out a few books on the subjects. ASP.Net is really a different animal and if you don't use the new ways, it might not work good for you.

Any of the Wrox books or ASP.Net Unleashed are goods ones to start with.

ADO.Net is one of the best things.

duckhunter

3:42 am on Oct 15, 2003 (gmt 0)

10+ Year Member



I agree with korkus. My .NET sites scream compared to the asp ones I wrote. There are some extremely powerful tools in .NET that, if used incorrectly, can bring a server to it's knees. Read up, indeed. Go to a few conferences, develop three sites before trying to put one in production. It takes a little getting used to but once you get the knack, it rocks.

markus007

5:03 am on Oct 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



caching
caching
caching

ASP.net blows ASP out of the water, especially when you cache intensive database queries, or your homepage for 5-10 minutes at a time.

TheNige

3:08 am on Oct 16, 2003 (gmt 0)

10+ Year Member



agreed, the caching object is great. Once you get into the .Net way of thinking and coding....you actually start to laugh at how you used to have to code in classic ASP. I wince everytime I have to touch my old ASP code now.

pedrodepacos

4:36 am on Oct 16, 2003 (gmt 0)

10+ Year Member



Please, for anyone out there who is starting to learn ASP.NET or thinking of moving to ASP.NET, please take the time to learn everything you can about caching. I cannot believe the amount of sites that continuously hit databases even when the information rarely changes.

I just wish that I could have my first few projects back in which I didn't use caching to its full potential.