2

I'd like to know if it's necessary to compile linq queries to the subsonic entities?

For example would I'd need to compile the following linq query?

var comments = from a in All()
                           where a.ParentCommentId == ArticleCommentId
                           select a;
Raúl Roa
  • 12,061
  • 13
  • 49
  • 64

1 Answers1

1

Compiled queries are an optional optimization that allow you avoid parsing an expression tree multiple times. It's never required, but may be necessary to meet your performance requirements.

dahlbyk
  • 75,175
  • 8
  • 100
  • 122
  • 1
    I should mention that the cost can be quite significant unexpectedly. Any place where a query is invoked in a loop may need either refactoring or compiling the queries in the loop. Otherwise a tiny innocent-looking query invoked a mere 10 times may suddenly give you a 0.5 second delay in the user interface. – Roman Starkov Nov 09 '09 at 13:36