advertisement

Performance doesn't matter

posted by Jeff
Discuss this article   Printer friendly

Just because you can calculate the exact date of the Big Bang with your Web application doesn't mean you need to.

Performance doesn't matter. You heard me.

Got your attention? Good! I have to partially retract the above statement. Performance does matter, but not all of the time. This became obvious to me as I read an intellectual battle-royal between some developers who blog on Weblogs @ ASP.NET and even more folks over on the www.asp.net forums. The big debate was about the use of stored procedures in SQL Server versus so-called "ad hoc" queries made from your code.

The merits of both sides of the argument not withstanding, the debate ignored one of the key premises that have made any kind of development on the Web almost a given on every site: Code monkeys do what gets the job done the best way they know how, even if it's not the "best" way to go about it.

That's a pretty strange realization for someone like me, who spent a lot of weeks last year trying to get POP Forums to be as fast as humanly possible. I figured if Google could get their search results in under three tenths of a second, I could do my part to get my forum pages rendering in a hundredth of a second or less (and I succeeded in some respects).

This is where too often people who have immersed themselves deep in enterprise architecture start to lose touch with what's going on in the bulk of Web development. If you have that big league experience, you follow fairly standard practices and patterns to design applications that can handle the stress of hundreds (maybe thousands) of transactions per second. That's a good thing, because not everyone gets to acquire that experience, let alone share it.

However, if I had to guess, that experience is not the bulk of what goes on across the Internet. Yes, there are huge banking and insurance applications on the Internet. However, for every one of those giant applications there are likely thousands of smaller personal sites that do everything from blogs to simple news headlines.

That brings us back to the debate I mentioned. Is the small developer that runs a fan site on stamp collecting wrong because she doesn't use stored procedures to fetch her news headlines? Absolutely not! (We do hope that she's parameterizing her queries, but she's certainly not wrong.) If she gets a couple thousand page views a day, and all she does is show headlines, she doesn't need some giant n-tier application that can drive a rover on Mars.

Obviously Microsoft itself feels that the gains made in making development simple are worth the trade-offs in performance. The next version of ASP.NET, known as Whidbey, shows just how serious they are about it. You'll be able to put a DataSouce control right in your page, complete with connection strings and SQL statements, and bind your list controls right to it. You won't need a single line of code to make it work.

Can you imagine? Putting elements of a data access layer in your presentation layer? I'm sure that it makes object-oriented die-hards get a twitch in their neck and a dry mouth. Enterprise architects stand up and dismiss the practice with a nose to the air and a tight grip on their wireless mouse (that or they start posting about how your DBA on staff can help you... as if everyone has a DBA at their disposal). These camps frequently can't see that these pattern-breaking code monkeys are building applications that suit their needs quickly and easily, empowered by the simplicity of their platform.

ASP.NET is a fabulous platform for us to build our Web applications on, and no one questions that its architecture and object-oriented nature is a huge part of what makes it so powerful. It's the duty of experienced developers and sites like this one to spread the gospel and share our experience, so that the next person we hire at our big fancy enterprise job is better suited to our needs.

However, it's not our place to forget that what might appear the "quick and dirty" way to do things is frequently worth every penny in terms of time spent solving a problem. Not every application needs to be broken up into discreet layers because the difference in performance is too insignificant to bother spending all of that time on it to get there.

Think about it... why is PHP so popular? It's easy to learn, it does most of the basic things you need and it can pull out data with just a little bit of code. You see people getting into holy wars about how PHP is inferior to, well, almost anything else, but those leading such crusades never stop to see that PHP is making it quick and easy for people to build simple Web applications.

Performance actually does matter, but like everything in software development, the expected outcome must be weighed against the cost, in terms of time and money, required to get there.