PopularityList improvement suggestion

jvenero
2011-08-11
2013-04-29
  • jvenero
    jvenero
    2011-08-11

    I think is possible to improve tcp session pool lookup performance if the SortedList is replaced by some kind of hash map/set. As the key of the SortedList is a hash code of the session, and any previous session is replaced by new ones with the same hash; for a given session hash code allways there is only one entry in the pool, so that's why I think the hash map will do the job better…
    Have a nice day.

     
  • Erik Hjelmvik
    Erik Hjelmvik
    2011-09-15

    I've actually evaluated how changing this SortedList to a HashList, and I actually got better results for the SortedList. It really depends on how many objects the list contains and how many updates that are made to the list. SortedLists are also very good if you need to enumerate all objects in the list in a sorted order.

    Btw, here is a good evaluation of different list types:
    http://blog.bodurov.com/Performance-SortedList-SortedDictionary-Dictionary-Hashtable/