比较大型集合的 i4o 与 PLINQ
我有一个问题想问任何有 i4o 或 PLINQ 经验的人。 我有一个大对象集合(大约 400K )需要查询。 逻辑非常简单明了。 例如,有一个 Person 对象的集合,我需要找到与相同的名字、姓氏、出生日期或名字/姓氏的第一个首字母等匹配的人员。使用 LINQ to Object 这只是一个耗时的过程。
我想知道 i4o (http://www.codeplex.com/i4o)
或 PLINQ 是否可以提供帮助关于提高查询性能。 哪一个更好? 如果有任何方法。
谢谢!
I have a question for anyone who has experience on i4o or PLINQ. I have a big object collection (about 400K ) needed to query. The logic is very simple and straightforward. For example, there has a collection of Person objects, I need to find the persons matched with same firstName, lastName, datebirth, or the first initial of FirstName/lastname, etc. It is just a time consuming process using LINQ to Object.
I am wondering if i4o (http://www.codeplex.com/i4o)
or PLINQ can help on improving the query performance. Which one is better? And if there has any approach out there.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 400k 对象,我想知道数据库(进程内或进程外)是否不是更合适的答案。 然后,这抽象了索引创建过程。 特别是,任何数据库都将支持不同列上的多个不同索引,使得引用的查询都非常受支持,而不必为每个查询专门编码(只需让查询优化器担心它)。
在内存中使用它可能是有效的,但您可能(使用普通.NET)必须执行更多的手动索引管理。 听起来,i4o 肯定值得研究,但我没有任何现有的比较数据。
With 400k objects, I wonder whether a database (either in-process or out-of-process) wouldn't be a more appropriate answer. This then abstracts the index creation process. In particular, any database will support multiple different indexes over different column(s), making the queries cited all very supportable without having to code specifically for each (just let the query optimizer worry about it).
Working with it in-memory may be valid, but you might (with vanilla .NET) have to do a lot more manual index management. By the sounds of it, i4o would certainly be worth investigating, but I don't have any existing comparison data.
i4o :旨在通过使用旧关系数据库时代的索引来加速使用 linq 的查询。
PLinq:旨在使用额外的CPU核心来并行处理查询。
如果性能是您的目标,根据您的硬件,我建议使用 i4o,它将带来巨大的改进。
i4o : is meant to speed up quering using linq by using indexes like old relational database days.
PLinq: is meant to use extra cpu cores to process the query in parallel.
If performance is your target, depending on your hardware, I say go with i4o it will make a hell of improvement.
我没用过i4o,但我用过PLINQ。
如果不知道您要改进的查询的具体情况,很难说哪个(如果有的话)会有帮助。
PLINQ 允许在适用的情况下对查询进行多重处理。 然而,有时并行处理不会有帮助。
i4o 看起来有助于索引,这会加快某些调用的速度,但不会加快其他调用的速度。
底线是,这取决于正在运行的查询。
I haven't used i4o but I have used PLINQ.
Without know specifics of the query you're trying to improve it's hard to say which (if any) will help.
PLINQ allows for multiprocessing of queries, where it's applicable. There are time however when parallel processing won't help.
i4o looks like it helps with indexing, which will speed up some calls, but not others.
Bottom line is, it depends on the query being run.