SortedList<>, SortedDictionary<> and Dictionary<>

前端 未结 6 775
臣服心动
臣服心动 2020-11-28 02:58

I find that SortedList SortedDictionary and Dictionary implement the same

6条回答
  •  情歌与酒
    2020-11-28 03:12

    To summarize the results of a Performance Test - SortedList vs. SortedDictionary vs. Dictionary vs. Hashtable, the results from best to worst for different scenarios:

    Memory Usage:

    SortedList
    Hashtable
    SortedDictionary
    Dictionary
    

    Insertions:

    Dictionary
    Hashtable
    SortedDictionary
    SortedList
    

    Search Operations:

    Hashtable
    Dictionary
    SortedList
    SortedDictionary
    

    foreach loop operations

    SortedList
    Dictionary
    Hashtable
    SortedDictionary
    

提交回复
热议问题