none
LINQ performance RRS feed

  • Question

  • Dear all,
    I coded my program by Linq, i want to ask about Linq performance.
    If i use LINQ with big database and SQL, what does it cost ? LINQ vs SQL.
    Can I use LINQ in .NET 2.0 ? please show me how ....
    Thanks all,


    Wednesday, July 15, 2009 3:23 PM

Answers

  • In general, the overhead of using L2S is minimal and the extra overhead is [in the majority of all cases] purely client side. DB-side you will often encounter savings as L2S will do query optimizations before hitting the database; eliminating predicates that can be eliminated etc. This means that for distributed systems you can scale up in the middle tier to get a db-side performance advantage. For apps that run on a single system it will make little difference but for large systems this can be a huge advantage...

    That said, there are a couple of issues that can sometimes have a negative performance impact, for example the tendency to favor nvarchar params over varchar in some kinds of queries. All of those are easily worked around though, as long as you're aware of the possibility and as long as you keep an eye on db-side query behaviour and performance.


    Kristofer - Huagati Systems Co., Ltd. - Cool tools for Linq-to-SQL and Entity Framework: www.huagati.com/dbmltools (VS designer add-in), www.huagati.com/L2SProfiler (query profiler for L2S)
    Wednesday, July 15, 2009 4:24 PM
    Answerer