Linq to sql works faster than linq to memory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anotherone
    New Member
    • Feb 2010
    • 4

    Linq to sql works faster than linq to memory

    Having strong demand to develop fast paging in my ASP.NET application I tried to cache my tables for display. And I was quite surprised when occurred that my LINQ to memory application made paging 8 times slower than LINQ to SQL.

    For checking that I developed 2 ASP.NET applications. Both work with tables of having 500 000 records 3 fields each record (the memory structure is identical to SQL table). The controls used are regular: GridView and ObjectDataSourc e. In the applications I calculate the average time needed for each paging click processing.

    LINQ + MS SQL application demands 0.1 sec per page change.
    LINQ + Memory Structure demands 0.8 sec per page change.

    Why the application handling data in memory works 8 times slower than the application using hard drive? Can anybody tell me why that happens?

    (both projects are attached here)
    Attached Files
Working...