0

We found an interesting article about improving performance of Entity Framework by using "precompiled views": http://neverindoubtnet.blogspot.ch/2012/03/squash-entity-framework-startup-time.html

We have tried this - we use the EF Power Tools extension to auto-generate the precompiled views. Our application was still running afterwards, but I have doubts whether these views are being used at all.

The article above states that SQL Express must be installed. We use DevArt dotConnect with an Oracle database. I wonder how the Microsoft-cooked EF Power Tools should know how the correct SQL for the precompiled views looks like. Does it look at the web.config and find that dotConnect is the provider and retrieve the SQL statements from that provider?

To lead this ad absurdum, I messed up all the strings in the precompiled views file (DataContext.Views.cs) and ran the application - it still worked perfectly.

chiccodoro
  • 14,407
  • 19
  • 87
  • 130
  • Have you figured out why your precompiled views class wasn't getting used? I'm having a similar issue. – Kon May 21 '13 at 16:12
  • @Kon: Unfortunately we started to have issues even generating the views and finally gave up on this. – chiccodoro May 24 '13 at 11:29
  • I gotcha. Btw, I finally figured out how to get the views to get used, but unfortunately, it's not via IIS and the web app - only through a console app. So that didn't help me much either. I did some perf monitoring/timing though and came to the conclusion that the pregenerated views weren't winning me much (if anything at all). – Kon May 24 '13 at 14:51

1 Answers1

0

I have doubts whether these views are being used at all

Set a break point in the context constructor in the file with a precompiled view to find out if the view is used by runtime.

I messed up all the strings in the precompiled views file (DataContext.Views.cs) and ran the application - it still worked perfectly.

EF runtime doesn't use a precompiled view if it was modified manually.

Devart
  • 119,203
  • 23
  • 166
  • 186