LOL. Looks like you did a sufficient job of inspiring one hell of a micro-optimization theatre in the comments with this thread.
I completely agree that LinqToSQL is very convenient and useful tool. Since I learned it, I have had only one instance where I’d use traditional SPROCS over it and that required an extensive read/process/write step to occur in no more than 100ms (obviously not web stuff).
If there is no better example, the comment thread of this post poses a perfect case where the word scalability has become the next gen ::cringe::paradigm::/cringe:: “web 2.0” of software development.
Meaning that, any jackass who can write a loop and store a date/time value will be partaking in creating comprehensive statistical explanations of why solution x is faster than solution y. Welcome back to bike shed painting 101. Disclaimer: I can’t claim complete innocence, I have painted that bikeshed my fair share of times too.
I think, the real concept of scalability represents 2 things.
- Raw performance
I if the number of executions is increased at a linear rate is the processing time growth linear, exponential, or lograrithmic. I’d consider logarithmic growth = scalable and optimized, linear growth = scalable, and exponential growth = not scalable.
Ex. If your site grows 10x in popularity is it going to need 5x, 10x, or 100x the servers to keep up with the demand?
- Application Domain
You put the difference into perspective perfectly. “Let’s do the math, even though I suck at it. Each uncompiled run of the query took less than one third of a millisecond longer.” Once again, you prove that you’re smarter than the average code monkey and that’s why I like your blog. I can actually feel myself not grow dumber the longer I read your material.
Unfortunately, scaling has hit the “scene” and all the code monkeys have their panties in a bunch. There’s masses of really bad/incorrect examples going around about optimization. It’s gonna take a colossal amount of panty un-twisting to fix it.
For websites specifically. I’d specify the domain range as 7 seconds. You have 7 seconds to load everything before the tip of the ADHD afflicted masses start to flee in troves, followed by average people (15 sec), and finally the brutally patient (whatever the timout rate is). If your page can’t load in less than 7 seconds you’re doing it wrong. There are much better optimizations that can occur in this scope (eliminating file requests from the server, or from multiple servers::cringe:
than trimming off a few ms from a DB query.
My .02 on perf.
@ Ric Johnson
Although most people don’t know. Linq is about more than SQL ORM. Linq can be performed on XML, Collections, etc… For anybody that has used Linq extensively, it’s pretty obvious that the functionality doesn’t do a good job of supporting changes in the database model.
I think they’re also leading away from LinqToSql because it only supports MsSql. What about all of the other modeling systems out there? LinqToOracle, LinqToMySql, LinqToPostgre, etc… The name and application itself isn’t general enough to cover all the systems that people will eventually expect of it. Neither Linq or LinqToSql are going anywhere. Linq will be around forever, and LinqToSql will sit quietly in the .Net framework and do what it does best. I think their development emphasis will just be directed more toward Entities for the ORM part and LinqToEntities for the querying part.