Why is ASP so SLOW?! [modified]
-
This is a really good question and I am disappointed that going through the threads I just find weird denials without addressing the question. ASP may or may not be slower than PHP. It is completely valid to compare them as they are both options in setting up a site, and the choice is fundamental to what kind of server you want to set up. I don't really know as I switched from asp to php a while back because of the bugginess of frontpage extensions, and the solid reliability of apache. Apache can go down and php sites can break, but it is usually understandable user error. With iis/frontpage, trying to follow the codes it would add in and debugging officially undocumented quirks drove me nuts. Apache/PHP is still at a programming language level, but it seems much more straight-forward than trying to get IIS/Frontpage to behave. In short, I don't know and I thought it was a good question. Saying you can't compare them or that it is all in the coder is being ignorant that there are differences between the two and it is good to know what performs better for what.
I totally disagree with you on this. The programmer ultimately has more control over how a site performs then any other factor. I've seem some very poorly designed PHP sites that were slow, and I've seen poorly designed ASP(X) sites that were slow. I've also seen some wickedly fast php and asp(x) sites that do basically the same thing as the poorly designed sites, they just do it a ton faster and more efficiently. The biggest difference is still the skill level of the programmer, not the language because they are all pretty solid right now. ASP tends to have a ton more entry level programmers, guys who come from a different background then say, Computer Programming. I happen to be one of those guys, I came from an engineering (chemical) background that used to tons of VBA work in Excel and from there transitioned into the web. Some of my first work as an ASP programmer was HORRIBLE, but remember I had no training, etc. I didn't understand the importance of things like garbage collection, caching, etc. My knowledge of DBs consisted of using access, so the concepts of configuring the indexes, etc was completely foreign to me. I don't know of a single php programmer that came from a non computer background. Sure, there are some out there, but on the norm, there are many more non-computer based asp(x) programmers as compared to php. I don't care how fast a language or server is, if the programmer doesn't have a clue and writes horrible code the application will be slow.
-
nalorin wrote:
I suppose the experience of the coder plays a huge part ^_^
it plays a HUGE part! anyone not experienced can totally screw up any and every language known to man. :-D
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Maybe you will remember this one El Corazon, when we were discussing ridiculous code. It is the Quadrasort. This is code written on a platform that can achieve decent speed, but the design is so bad that the algorithm will be slower than the slowest scripting languages in achieving results. See it at: http://thedailywtf.com/Articles/The\_Quadrasort.aspx (hey, an ASP page, let's see how fast it loads) "anyone not experienced can totally screw up any and every language known to man" (El Corazon) This seems to support that claim, as does George Bush's use of English. ;)
-
It's because IIS is driven by hamsters, while Apache is driven by gerbils. The gerbils run slightly faster than the hamsters but they wear out more quickly. That's why Apache has so many plug-in modules - it saves the server administrator from having to replace so many gerbils all the time.
Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:
-
Maybe you will remember this one El Corazon, when we were discussing ridiculous code. It is the Quadrasort. This is code written on a platform that can achieve decent speed, but the design is so bad that the algorithm will be slower than the slowest scripting languages in achieving results. See it at: http://thedailywtf.com/Articles/The\_Quadrasort.aspx (hey, an ASP page, let's see how fast it loads) "anyone not experienced can totally screw up any and every language known to man" (El Corazon) This seems to support that claim, as does George Bush's use of English. ;)
NimitySSJ wrote:
It is the Quadrasort.
that mountain of smelly code is forever burned into my brain.... even the reminders don't really remind me of it anymore, it is always there churning.... repeating the mantra... "never do this.... never do this...." :-D
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
It's because IIS is driven by hamsters, while Apache is driven by gerbils. The gerbils run slightly faster than the hamsters but they wear out more quickly. That's why Apache has so many plug-in modules - it saves the server administrator from having to replace so many gerbils all the time.
Please don't bother me... I'm hacking right now. Don't look at me like that - doesn't anybody remember what "hacking" really means? :sigh:
-
I think what you mean is "Why are asp.net sites so slow?" Just because a website may be slow doesn't mean the technology used is slow. A lot of things affect the site speed, the biggest 2 being 1) volume of HTML, images, css linkes, etc.. and 2) Complexity of the database queries, and how well they're written. In general, my experience has been that ASP.NET is significantly faster than scripted ASP or PHP, but it's also a lot more poweful. When you put power in the hands of a developer, they use that power, and before you know it they're doing 20 SQL Queries with 55 internal joins, taking 15 seconds just to execute the sql query. PHP, frankly, requires a lot more work to do complex things, so most PHP sites are not that complex. There are the few exceptions...
-- Where are we going? And why am I in this handbasket?
Erik Funkenbusch wrote:
A lot of things affect the site speed, the biggest 2 being 1) volume of HTML, images, css linkes, etc.. and 2) Complexity of the database queries, and how well they're written.
I realize this. As I've stated earlier, there were things that I didn't take into consideration (particularly hardware, and programmer experience, etc) - I do that sometimes :P
"Silently laughing at silly people is much more satisfying in the long run than rolling around with them in a dusty street, trying to knock out all their teeth. If nothing else, it's better on the clothes." - Belgarath (David Eddings)
-
You're a child of the internet? Was it your mother or your father? Was your other parent a toaster?
Deja View - the feeling that you've seen this post before.
Pete O'Hanlon wrote:
Was your other parent a toaster?
I don't appreciate the racial slur against my Cylon mother! (If anyone's not as big of a nerd as I, Look up Battlestar Gallactica on Wikipedia, or something :D)
"Silently laughing at silly people is much more satisfying in the long run than rolling around with them in a dusty street, trying to knock out all their teeth. If nothing else, it's better on the clothes." - Belgarath (David Eddings)
-
I am not sure that ASP is slow, but in the interests of 'debate'. ;) Because ASP runs on MS servers, and PHP runs on Linux. ;P (Runs for cover) My Blog
KramII
KramII wrote:
Because ASP runs on MS servers, and PHP runs on Linux. (Runs for cover)
But you can run ASP on Linux servers (using open-source clones), and PHP on Winnoes, so this says nothing! If you didn't take a stab at mocking Microsoft, I'd chase you with a torch and pitchfork! :P
"Silently laughing at silly people is much more satisfying in the long run than rolling around with them in a dusty street, trying to knock out all their teeth. If nothing else, it's better on the clothes." - Belgarath (David Eddings)
-
This is a really good question and I am disappointed that going through the threads I just find weird denials without addressing the question. ASP may or may not be slower than PHP. It is completely valid to compare them as they are both options in setting up a site, and the choice is fundamental to what kind of server you want to set up. I don't really know as I switched from asp to php a while back because of the bugginess of frontpage extensions, and the solid reliability of apache. Apache can go down and php sites can break, but it is usually understandable user error. With iis/frontpage, trying to follow the codes it would add in and debugging officially undocumented quirks drove me nuts. Apache/PHP is still at a programming language level, but it seems much more straight-forward than trying to get IIS/Frontpage to behave. In short, I don't know and I thought it was a good question. Saying you can't compare them or that it is all in the coder is being ignorant that there are differences between the two and it is good to know what performs better for what.
I don't think that it's "all in the coder['s ignorance]" is really what I said, though. Essentially, I meant that the experience of the coder can greatly affect the performance of a site. Someone argued against this point saying that the less experienced coders will connect with the "Wizards", and essentially learn their tricks. However true this may be, an inexperienced coder is more likely to program it how he knows first (resulting in slow page load times), then go back after he's learned better from the Gurus.
"Silently laughing at silly people is much more satisfying in the long run than rolling around with them in a dusty street, trying to knock out all their teeth. If nothing else, it's better on the clothes." - Belgarath (David Eddings)
-
I just had an interesting question. I've used many websites, being a child of the internet. And, in all my days of surfing, I've found that, in general, PHP-driven sites generally take less time to load than ASP sites. I've found that in about 4/5 cases (particularly with forums), sites that are obviously ASP-driven (you can see the .asp(x) extension in the URLs) often take several seconds longer to load than similar pages that are obviously PHP-driven. Any suggestions on why this seems to be? (I'm not saying ASP /IS/ slower... just that it /seems/ slower - my answer to my own question would be "Microsoft", which should explain everything, but I want the nitty gritty details!)
modified on Wednesday, February 27, 2008 7:33 PM
I agree with what other people have said that it really depends on the application, the programmer, the db and hardware. I think if you could make an exactly equivalent app in ASPX and PHP, and run it on exactly equivalent hardware, then the ASPX would actually run faster, just because it's compiled. I'll say that ASPX sites tend to be more complex, and because of that there's more the programmer can do wrong that will make it run slower. There's part of your answer. I'll also say that one really common reason that ASPX sites run slowly is out-of-control viewstates. Something like a forum that uses a repeater could have viewstate info for every control shown on the page, and that viewstate has to get transferred over the wire in both directions. So it's just the extra bandwidth making it seem slow. (I have actually coded pages with >200KB viewstates. My bad...)
-
I don't think that it's "all in the coder['s ignorance]" is really what I said, though. Essentially, I meant that the experience of the coder can greatly affect the performance of a site. Someone argued against this point saying that the less experienced coders will connect with the "Wizards", and essentially learn their tricks. However true this may be, an inexperienced coder is more likely to program it how he knows first (resulting in slow page load times), then go back after he's learned better from the Gurus.
"Silently laughing at silly people is much more satisfying in the long run than rolling around with them in a dusty street, trying to knock out all their teeth. If nothing else, it's better on the clothes." - Belgarath (David Eddings)
Yea, the wizards is why I moved from Frontpage/IIS/ASP, because it tended to want to do things in clunky ways. I spent more time wrestling with the Wizard's results or trying to emulate them with tweaks to get just what I wanted, than it would take to just create from scratch it with better understanding. I was not specifically dogging your response, it just was I was looking for some reasonable analysis of the question and I could not find any answer that addressed actual speed differences between php and asp for specific modules, scenarios, etc. The reponses seemed to hinge on implying that there was no difference, or you couldn't compare, which did not seem to make sense, since there must be some difference, even if it is situational, and since they are competing languages/platforms, there must be a rational to compare what handles what better. Thanks
-
Your question is not interesting at all. There is more than one factor involved in a web app, other than the platform (being .NET, PHP, Java, Perl and so on). Application and database design and implementation greatly affect application performance. Furthermore, you have to look at the hardware other environmental factors. :confused:
-
I agree with what other people have said that it really depends on the application, the programmer, the db and hardware. I think if you could make an exactly equivalent app in ASPX and PHP, and run it on exactly equivalent hardware, then the ASPX would actually run faster, just because it's compiled. I'll say that ASPX sites tend to be more complex, and because of that there's more the programmer can do wrong that will make it run slower. There's part of your answer. I'll also say that one really common reason that ASPX sites run slowly is out-of-control viewstates. Something like a forum that uses a repeater could have viewstate info for every control shown on the page, and that viewstate has to get transferred over the wire in both directions. So it's just the extra bandwidth making it seem slow. (I have actually coded pages with >200KB viewstates. My bad...)
-
I totally disagree with you on this. The programmer ultimately has more control over how a site performs then any other factor. I've seem some very poorly designed PHP sites that were slow, and I've seen poorly designed ASP(X) sites that were slow. I've also seen some wickedly fast php and asp(x) sites that do basically the same thing as the poorly designed sites, they just do it a ton faster and more efficiently. The biggest difference is still the skill level of the programmer, not the language because they are all pretty solid right now. ASP tends to have a ton more entry level programmers, guys who come from a different background then say, Computer Programming. I happen to be one of those guys, I came from an engineering (chemical) background that used to tons of VBA work in Excel and from there transitioned into the web. Some of my first work as an ASP programmer was HORRIBLE, but remember I had no training, etc. I didn't understand the importance of things like garbage collection, caching, etc. My knowledge of DBs consisted of using access, so the concepts of configuring the indexes, etc was completely foreign to me. I don't know of a single php programmer that came from a non computer background. Sure, there are some out there, but on the norm, there are many more non-computer based asp(x) programmers as compared to php. I don't care how fast a language or server is, if the programmer doesn't have a clue and writes horrible code the application will be slow.
droth17 wrote:
I don't know of a single php programmer that came from a non computer background. Sure, there are some out there, but on the norm, there are many more non-computer based asp(x) programmers as compared to php. I don't care how fast a language or server is, if the programmer doesn't have a clue and writes horrible code the application will be slow.
If you go beyond professional programmers, PHP is popular among people slapping up personal websites because it comes free with *nix web hosting and doesn't require any commercial tools to use.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop. -- Matthew Faithfull
-
I just had an interesting question. I've used many websites, being a child of the internet. And, in all my days of surfing, I've found that, in general, PHP-driven sites generally take less time to load than ASP sites. I've found that in about 4/5 cases (particularly with forums), sites that are obviously ASP-driven (you can see the .asp(x) extension in the URLs) often take several seconds longer to load than similar pages that are obviously PHP-driven. Any suggestions on why this seems to be? (I'm not saying ASP /IS/ slower... just that it /seems/ slower - my answer to my own question would be "Microsoft", which should explain everything, but I want the nitty gritty details!)
modified on Wednesday, February 27, 2008 7:33 PM
Personally I don't think this is a bad question at all! ASP, I believe, appears slower because the pages are! You will find that some pages are not pre-compiled, so when you hit the web-server the compilation happens and that slows the page down, to begin with at least. Once compiled you should have a reasonably fast time browsing the site. However, anything written in .NET is very page-heavy as it adds a whole heap of Javascript and rather long id's to each element in the page (if it is an asp control.) If you want to cut that down you need to do it yourself instead of providing asp controls that really don't need to be 'runat="server".' Often a developer will just simply drag a label onto the page in design view rather than write text into it, and that just adds more overhead. Visual Studio 2008 helps with this as it is much more HTML friendly. It's not ASP that is the slow part, it is the developer generally making the page large, and people who watch all those 'how to' videos to begin their ASP.NET development without knowing about what is going on behind the scenes are probably the ones making the slow pages :P
-
Pete O'Hanlon wrote:
Was your other parent a toaster?
I don't appreciate the racial slur against my Cylon mother! (If anyone's not as big of a nerd as I, Look up Battlestar Gallactica on Wikipedia, or something :D)
"Silently laughing at silly people is much more satisfying in the long run than rolling around with them in a dusty street, trying to knock out all their teeth. If nothing else, it's better on the clothes." - Belgarath (David Eddings)
Nope - I'm a nerd. So, was she a Centurion or an Android?
Deja View - the feeling that you've seen this post before.
-
I just had an interesting question. I've used many websites, being a child of the internet. And, in all my days of surfing, I've found that, in general, PHP-driven sites generally take less time to load than ASP sites. I've found that in about 4/5 cases (particularly with forums), sites that are obviously ASP-driven (you can see the .asp(x) extension in the URLs) often take several seconds longer to load than similar pages that are obviously PHP-driven. Any suggestions on why this seems to be? (I'm not saying ASP /IS/ slower... just that it /seems/ slower - my answer to my own question would be "Microsoft", which should explain everything, but I want the nitty gritty details!)
modified on Wednesday, February 27, 2008 7:33 PM
Everytime I go to a PHP site I dread the load time...
Steve Naidamast Black Falcon Software, Inc. blackfalconsoftware@ix.netcom.com
-
I just had an interesting question. I've used many websites, being a child of the internet. And, in all my days of surfing, I've found that, in general, PHP-driven sites generally take less time to load than ASP sites. I've found that in about 4/5 cases (particularly with forums), sites that are obviously ASP-driven (you can see the .asp(x) extension in the URLs) often take several seconds longer to load than similar pages that are obviously PHP-driven. Any suggestions on why this seems to be? (I'm not saying ASP /IS/ slower... just that it /seems/ slower - my answer to my own question would be "Microsoft", which should explain everything, but I want the nitty gritty details!)
modified on Wednesday, February 27, 2008 7:33 PM
-
I just had an interesting question. I've used many websites, being a child of the internet. And, in all my days of surfing, I've found that, in general, PHP-driven sites generally take less time to load than ASP sites. I've found that in about 4/5 cases (particularly with forums), sites that are obviously ASP-driven (you can see the .asp(x) extension in the URLs) often take several seconds longer to load than similar pages that are obviously PHP-driven. Any suggestions on why this seems to be? (I'm not saying ASP /IS/ slower... just that it /seems/ slower - my answer to my own question would be "Microsoft", which should explain everything, but I want the nitty gritty details!)
modified on Wednesday, February 27, 2008 7:33 PM
If you want real speed, step back in time, to straight HTML, and perl scripting. Do not use style sheets, or ActiveX, or IIS, or any other M$ tech, and program your site exactly for what it is supposed to do and nothing more. Its not glamorous, and pretty, but it beats the pants off glamorous, glitzy websites written in anything else, as far as speed goes. As a bonus it will be hard to be hacked, not utilizing ActiveX, and other arbitrary coding schemes that can expose your file system and process space to arbitrary code. If you want pretty things with lots of advertising, expect to be slow, or need lots of hardware to compensate. Experienced programmer's know how to write optimized code, and organize through convention and dicipline, what ASP/.Net/FrontPage/IIS and the like try to enforce through language syntax, object models, templates, stylesheets, and wizards. To truly answer the question, we would need to produce a controlled experiement, developeing the same web app/site in each language, running on equivalent hardware. The code for both should be reviewed by many that it is the most efficient it can be, for the functions involved, and then start hitting it. The basic functions of this site should included all of the neccessary functions for measuring and tracking its performance, which could really be the primary function: measureing, recording, tracking, and reporting all aspects of the site performance for all users.
-
If you want real speed, step back in time, to straight HTML, and perl scripting. Do not use style sheets, or ActiveX, or IIS, or any other M$ tech, and program your site exactly for what it is supposed to do and nothing more. Its not glamorous, and pretty, but it beats the pants off glamorous, glitzy websites written in anything else, as far as speed goes. As a bonus it will be hard to be hacked, not utilizing ActiveX, and other arbitrary coding schemes that can expose your file system and process space to arbitrary code. If you want pretty things with lots of advertising, expect to be slow, or need lots of hardware to compensate. Experienced programmer's know how to write optimized code, and organize through convention and dicipline, what ASP/.Net/FrontPage/IIS and the like try to enforce through language syntax, object models, templates, stylesheets, and wizards. To truly answer the question, we would need to produce a controlled experiement, developeing the same web app/site in each language, running on equivalent hardware. The code for both should be reviewed by many that it is the most efficient it can be, for the functions involved, and then start hitting it. The basic functions of this site should included all of the neccessary functions for measuring and tracking its performance, which could really be the primary function: measureing, recording, tracking, and reporting all aspects of the site performance for all users.
If you really want to get a halfway valid comparison between asp, asp.net, lamp and/or any other platform, get a project going where you set a common set of criteria for a site in each platform to achieve and see who can come up with the best response times. Get each site hosted on the same machine and run some tests. There are enough talented programmers here to bash something together fairly quickly, the only problem would be finding an acceptable host.