Wednesday 15 August 2012

SQL FTW

One of the slower parts of the .Net app I part-support finally became enough of a squeaky wheel to get some grease: I replaced it with a single SELECT query in a little piece of PHP.

Before: c 13.2 seconds.
After: 151 milliseconds.

(Yes, it's retrieving the same fields from the same database, without any caching or other tricks involved - just replacing the craptacular C# dreck which goes through rehydrating objects with LINQ then spitting it all out as JSON with a straight SQL->json_encode.)