3

So, I am working on a project with a team and we are using Entity Framework. We basically want to use linq to entities, and not use stored procedures. I use quite a bit of lists and IEnumerables and so does everyone else.

My question is, will converting the dataset produced by a stored procedure to an IEnumerable dramatically slow down the applications performance speed, say it parses through 1,000's of rows. Or would it be better to convert the store procedure to linq to entities(the procedure is a bit complex).

We have not set up testing unit tests and integration yet.

2
  • 1
    When possible, use a datareader instead of a dataset if you want performance.
    – JeffO
    Feb 26, 2013 at 19:37
  • If the proc is complex, first make sure that in converting it, you get the same result. Personally I think you are foolish to consider converting a complex working proc to something else simply because you don't want to have procs. It is a waste of time and energy to do this and the likelihood you will introduce new bugs is high.
    – HLGEM
    Feb 27, 2013 at 16:40

1 Answer 1

1

Well, it depends. On most of the projects I have worked on, converting to a list has worked out just fine. As such, it is my usual first course of action in this situation. However, there have been times where converting to a list is too slow. My advice would be to try it and see if the performance is acceptable. If it is, great. If not, get out the profiler and make sure the list conversion is the real culprit. If it is, try making the procedure in linq to entities and see how it compares.

TL/DR: Try it. If it's not fast enough, try something else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.