ORM慢吗?有关系吗? [英] Is ORM slow? Does it matter?

查看:140
本文介绍了ORM慢吗?有关系吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与存储过程相比,我真的很喜欢ORM,但是我担心的一件事是,由于层层和抽象层的关系,ORM可能很慢.使用ORM会使我的应用程序变慢吗? 还是有关系吗?

I really like ORM as compared to store procedure, but one thing that I afraid is that ORM could be slow, because of layers and layers of abstraction. Will using ORM slow down my application? Or does it matter?

推荐答案

是的,很重要.它正在使用更多的CPU周期,因此降低了您的应用程序的运行速度.听我说...

Yes, it matters. It is using more CPU cycles and consequently slowing your application down. Hear me out though...

但是,请考虑一下:什么更昂贵?服务器硬件还是其他编程器?通常,服务器硬件比雇用另一组程序员便宜.因此,尽管ORM可能会浪费您的CPU周期,但您却需要更少的程序员来管理SQL查询,这通常会降低净成本.

But, consider this: what is more expensive? Server hardware or another programmer? Server hardware, generally, is cheaper than hiring another team of programmers. So, while ORM may be costing you CPU cycles, you need one less programmer to manage your SQL queries, often resulting in a lower net cost.

要确定是否值得您这样做,请使用ORM计算或确定节省了多少小时.然后,确定您在服务器上花费了多少钱来支持ORM.将您节省的小时数乘以小时费率,然后与服务器成本进行比较.

To determine if it's worth it for you, calculate or determine how many hours you saved by using an ORM. Then, figure out how much money you spent on the server to support ORM. Multiply the hours you saved by your hourly rate and compare to the server cost.

当然,ORM是否真的为您节省了时间,这完全是另一个争论……

Of course, whether an ORM actually saves you time is a whole another debate...

这篇关于ORM慢吗?有关系吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆