Why is parameterized SQL generated by NHibernate just as fast as a stored procedure?

前端 未结 13 2534
独厮守ぢ
独厮守ぢ 2020-12-14 20:47

One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any hel

13条回答
  •  半阙折子戏
    2020-12-14 21:17

    Even if the stored procedure is 10% faster (it probably isn't), you may want to ask yourself how much it really matters. What really matters in the end, is how easy it is to write and maintain code for your system. If you are coding a web app, and your pages all return in 0.25 seconds, then the extra time saved by using stored procedures is negligible. However, there can be many added advantages of using an ORM like NHibernate, which would be extremely hard to duplicate using only stored procedures.

提交回复
热议问题