LLBLGen Pro 性能如何与 Nhibernate 相比

发布于 2024-08-13 15:18:04 字数 83 浏览 3 评论 0原文

我在互联网上到处搜索 LLBLGen Pro 的任何性能信息。没有找到。只是想知道 LLBLGen Pro 与 Nhibernate 相比表现如何。谢谢

I have search the internet high and low looking for any performance information for LLBLGen Pro. None found. Just wanted to know how does LLBLGen Pro perform compared the Nhibernate. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拿命拼未来 2024-08-20 15:18:04

如果没有上下文,您的问题基本上无法回答。我要回答的问题将从:

  • 什么样的应用程序?以数据为中心?以业务逻辑为中心?
  • 我们谈论的是多少数据?
  • 我们谈论什么样的数据操作?主要是读书?主要是写?

总的来说,LLBLGen 的表现非常好。我们已经在我工作的 10 多个项目(包括一些企业级项目)中使用了它,我们看到的一些性能问题始终是由于误解代码的用途(有一个学习曲线)或物理模型实施不当(例如缺少索引)。

这两个框架处理数据访问问题的方式非常不同。 LLBLGen 的操作通常会转化为 SQL,如果您有强大的数据背景,那么这很容易理解。 NHibernate 在可能的情况下使用会话和缓存将数据保留在内存中,以提高性能(免责声明:我不是 NHibernate 专家)。 LLBLGen 不支持这种概念;相反,它在断开连接的状态下工作,并将更改跟踪信息直接存储在其实体对象上。

最重要的是,框架采用的方法非常不同,如果不了解更多关于系统功能的信息,很难预测哪个会表现更好。在正确的人手中,任何一个框架都可以用来设计一个数据访问性能不是主要性能瓶颈的系统。

Your question is essentially impossible to answer without context. The questions I would ask in response would start with:

  • What kind of application? Data-centric? Business logic-centric?
  • How much data are we talking about?
  • What kind of data operations are we talking about? Mostly reads? Mostly writes?

As a general matter, LLBLGen performs very well. We have used it on 10+ projects (including a few enterprise-scale projects) where I work, and the few issues we've seen with performance were always the result of misunderstand what the code was doing (there is a learning curve) or a poorly implemented physical model (e.g. missing indexes).

The two frameworks approach the problem of data access very differently. LLBLGen's operations generally translate into SQL that is fairly easy to understand if you have a strong data background. NHibernate uses sessions and cache to keep data in memory when possible to improve performance (disclaimer: I am not an NHibernate expert). LLBLGen does not support this sort of concept; instead it works in a disconnected state and stores change tracking information directly on its entity objects.

Bottom line, the approaches the frameworks take are very different, and it's hard to predict which will perform better without knowing more about what your system does. In the right hands, either framework can be used to design a system where data access performance is not a major performance bottleneck.

舟遥客 2024-08-20 15:18:04

最初我们测试了 LLBLGen @ ORMBattle.NET,它的物化速度比 NH 快约 2 倍; LINQ 查询编译时间相当不错(约 4000 个查询/秒),但 CUD 操作明显比 NH 慢(LLBLGen 中没有 CUD 批处理)。

当您在同一会话中处理大量对象时,这两个框架都必须相对较慢:

  • NH 由于其物化管道而相对较慢。我不完全确定为什么,但例如为了实现脏检查,NH 必须在某处存储任何物化对象的克隆。至少两倍的 RAM ~= 至少慢 2 倍。
  • LLBLGen 使用相对“胖”的实体 - 看起来它们将字段存储在字典中。显然,从性能的角度来看这并不好,因为 RAM 消耗是影响它的重要因素之一。

请参阅 此常见问题解答问题测试套件摘要以获得更深入的解释。

所以简而言之,LLBLGen Pro 读取速度肯定比 NH 快,但写入速度慢。

Initially we tested LLBLGen @ ORMBattle.NET, it was ~ 2 times faster than NH on materialization; LINQ query compilation time was pretty good (~ 4000 queries/sec.), but CUD operations were noticeably slower than in NH (there is no CUD batching in LLBLGen).

Both frameworks must be relatively slow in case when you deal with large amount of objects in the same session:

  • NH is relatively slow because of its materialization pipeline. I'm not fully sure why, but e.g. to implement dirty checking, NH must store a clone of any materialized objects somewhere. At least two times more RAM ~= at least 2 times slower.
  • LLBLGen uses relatively "fat" entities - it seems they store fields in dictionaries. Obviously, this isn't good from the point of performance, since RAM consumption is one of essential factors affecting on it.

See this FAQ question and Test Suite Summary for a bit deeper explanation.

So in short, LLBLGen Pro must be faster than NH on reads, but slower on writes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文