none
EF query generation vs writing your own stored procedures RRS feed

  • Question

  • Now I suppose writing your own store procs will always be potentially faster, but I believe in EF 6, even if you're a sql expert it's very hard to come up with something better.

    Is there some sort test like, "Do you think you can write better queries than EF 6?"

    I'm wondering how to show someone, that queries in EF 6 are much better than saw EF 3 or other ORMs


    dan

    Wednesday, June 15, 2016 5:37 AM

Answers

  • Hi danparker276,

    For most single-entity operations (CRUD) we will find just about equivalent performance with all two technologies.  You'd better know how EF work in order to use them to their fullest.  For high-volume operations like polling queries, we may want to have EF "compile" your entity query such that the framework doesn't have to constantly regenerate the SQL.

    For bulk updates where you're updating massive amounts of data, a stored procedure will always perform better than an ORM solution because you don't have to marshal the data over the wire to the ORM to perform updates.

    >> Is there some sort test like, "Do you think you can write better queries than EF 6?"

    The following article provide some test about entity framework and store procedure. it seems that store procedure is faster than entity framework when it need to retrieve massive amounts of data.

    http://www.progware.org/Blog/post/Slow-Performance-Is-it-the-Entity-Framework-or-you.aspx

    >> I'm wondering how to show someone, that queries in EF 6 are much better than saw EF 3 or other ORMs

    EF 6 improves startup and runtime performance, for more information, please refer to:

    http://blogs.msdn.com/b/adonet/archive/2013/10/17/ef6-rtm-available.aspx

    For more information about Performance Considerations with EF, please refer to:

    https://msdn.microsoft.com/en-us/library/cc853327.aspx

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 16, 2016 1:34 AM
    Moderator