-
Notifications
You must be signed in to change notification settings - Fork 208
Description
We're trying to sort out why some of our web pages are burning so much CPU and seem to have narrowed it down to SubSonic's LINQ implementation.
Using the standard T4 templates (although probably somewhat older version of the templates) I've found that running a simple SingleOrDefault query can be about 20x times slower than an equivalent CodingHorror query.
myrecord.SingleOrDefault(x=>x.name=="blah") = 200,000 ticks
CodingHorror("SELECT * FROM myrecords WHERE name=@p", "blah).ExecuteTypedList()[0] = 10,000 ticks.
This seems a pretty harsh performance hit and I'm wondering if this is typical and has it been improved in later versions of SubSonic (we're using a somewhat older build because we can't get the latest to work).
btw: Also, I found that I could improve SingleOrDefault in the generated template by replacing the Count() and ExecuteTypedList() with results.SingleOrDefault(). This took about 100,000 ticks.
We're running under .NET/Windows/MySQL.