1

I have a Entity Framework 4.1 DbContext based model. I am using a PocoModelGenerator.tt file to generate my entities. I found that querying a 20,000 row SQL table takes around 5 seconds from my code locally. It takes less than a second when done directly in SQL. In order to boost performance, I followed the approach in the link below to generate pre-compiled views:

http://blogs.msdn.com/b/adonet/archive/2008/06/20/how-to-use-a-t4-template-for-view-generation.aspx

But the performance didn't improve at all. It's actually a tad bit slower even when I am running it the 2nd or 3rd time. Here's the project structure I have:

enter image description here

Here are the properties for the generated MaterialsModel.Views.cs file:

enter image description here

I have the following questions:

  1. Any idea what can be the issue here?
  2. How do I check that the generated MaterialsModel.Views.cs is being compiled into the output assembly.
  3. How do I check that the generated views are indeed being used by my code?
  4. Are the properties setup correctly?
Yasir
  • 1,595
  • 5
  • 23
  • 42
  • How did you benchmark "done directly from SQL", did you do a full end to end test with results being displayed on a screen? – Aron Jul 24 '13 at 04:55

1 Answers1

0

Well answer to 3rd is very simple: Edit the view class and comment the call to Methods. Run your code, It should through exception.

10xAI
  • 154
  • 1
  • 8