LLBLGen Pro 性能如何与 Nhibernate 相比
我在互联网上到处搜索 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果没有上下文,您的问题基本上无法回答。我要回答的问题将从:
总的来说,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:
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.
最初我们测试了 LLBLGen @ ORMBattle.NET,它的物化速度比 NH 快约 2 倍; LINQ 查询编译时间相当不错(约 4000 个查询/秒),但 CUD 操作明显比 NH 慢(LLBLGen 中没有 CUD 批处理)。
当您在同一会话中处理大量对象时,这两个框架都必须相对较慢:
请参阅 此常见问题解答问题和测试套件摘要以获得更深入的解释。
所以简而言之,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:
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.