How to improve your LINQ query performance by 5 X times ?(c-sharpcorner.com)

submitted by nareshshnareshsh(824) 2 years, 8 months ago

LINQ has been criticized by many early adopters for its performance issues. Well if you are just going to drag and drop using DBML code generator I am sure you will land up in to mess. Try doing this make a simple LINQ to SQL project using DBML and see your

3 comments |category: |Views: 878

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by SuperJasonSuperJason(2740) 2 years, 8 months ago 0

LOL @ "Ignore this difference"

Reply

posted by DamienGDamienG(1405) 2 years, 8 months ago 0

This is not a great explanation - the author assumes that the compiled queries are stored statically ('In compiled LINQ queries the plan is cached in a static class.') This is not the case.

CompiledQuery.Compile simply returns you the complete compiled delegate ready to go - you store the compiled result in whatever scope you want - the CompiledQuery doesn't touch any static 'global cache' although you can store this result somewhere statically if you like.

The other part of the performance story is the object reader & materializer. These we build and execute as required and we hold the most recently used 10 on thread storage - again not in a static class - and there is no facility right now for you to tweak or change this caching mechanism.

[)amien

Reply

posted by dotnetnewbiedotnetnewbie(0) 2 years, 8 months ago 0

Don't waste your time reading this article.

The authors 5x times performance increase is going from 7 milliseconds to 2 milliseconds. Amazing right?

Reply

information Login or create an account to comment on this story