Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
When possible, use a datareader instead of a dataset if you want performance. – JeffO Feb 26 '13 at 19:37
@Jeff O Thanks, I will keep that in mind. – cocre8or Feb 26 '13 at 20:26
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 '13 at 16:40
@HLGEM that was good advice. thanks – cocre8or Mar 4 '13 at 3:29
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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