在C#中最快,最高效的集合类型 [英] Fastest and most efficient collection type in C#

查看:937
本文介绍了在C#中最快,最高效的集合类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个应用程序,这将需要收集保存有关字符串10K。

I am building an application which will require a collection to hold about 10k of Strings.

收藏将被用作队列。

所以一直在寻找通过在C#中不同的集合类型,但无法弄清楚哪一个有关于做着把速度最佳性能和队列获取操作。根据的意见,也应该能够不允许在队列/收藏复制品。

So was looking through different collection types in C# but could not figure out which one has best performance in regards to speed of doing Put and Get operation in Queue. Also should be capable of not allowing duplicates in the Queue/Collection.

编辑..

任何现有的收集将是有益的。或自定义集合可能出执行任何现有的集合将是巨大的。

Any existing collection will be helpful. Or a custom collection which could out perform any existing collection will be great.

感谢

推荐答案

有是保持了 OrderedDictionary 类插入订单,但允许您通过键查找值。

There is the OrderedDictionary class which keeps the insertion order but allows you to look up values by key.

这篇关于在C#中最快,最高效的集合类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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