1

I am using Singleton pattern for my application, I have used ADO.NET Entity framework as my Data Access Layer, after login to my application, it's taking 3 to 5 minutes to load the dashboard.

Is there a way to reduce the time? Or I have to look for some other methods instead of Entity framework?

gnat
  • 20,543
  • 29
  • 115
  • 306

2 Answers2

3

Entity Framework does have a warm up time but it's a couple of seconds. 3-5 minutes suggests something seriously wrong with your queries.

You should use something like Linqpad to see what SQL your LINQ to Entities is generating and work at optimizing it. Assuming of course you have done some troubleshooting and worked out that the DAL is your problem area.

If you are happy with the queries another area to look at if the data changes a lot is your indexes. Check your SQL Statistics are up to date and the fields being used for filtering are indexed.

Lotok
  • 1,809
2

Feel free to downvote since ORMs seem popular these days, but...

WHY are you using Entity Framework? Is there a possibility that the backend database might change? Are you nervous about writing SQL stored procedures to deliver your data?

Or possibly does it seem that writing a lot of transforms from DbDataReader rows to your objects might be a lot of work?

I'm asking because I've had the misfortune to work on a couple of projects where the developer went for Entity Framework and specifically, was ordered by management to rip it out and go to decent SQL Stored Procs (which can be optimized and have an execution plan) and datareaders PURELY because of the godawful performance you have also experienced.

Where a dashboard requires (according to SQL Profiler) in excess of 48,500 database calls to return before it ever loads, there is an issue. I never see this addressed, so I'm hoping some kind soul will enlighten me.