Hi,
I'm trying to find a collection type with key that offers fast lookup but also can be itterated though in order of insertion. The reason fot this is I am using it as a first in first out object cache. The cache has maybe 30,000 items. I used the dictionary class but this eventualy becomes unstable and crashes as I run out of ram. I tested simple LIST which is better but I must itterate over every item to find my result. Speed is one 3rd of the dictionary. I tried standard collections and keys, but performance is abismal.
So, is there a somthing in between? I cant find anything.
I want to be able to do a quick search for the key and also remove an item that was the oldest in order to add the new item. With an array that's easy. Drop the first, add to the end. Doesn't seem possible with dictionary without storing a value and itterating over all the data.
Performance I got with dict was 1300 per second, with list, 337 per second, with collection, 10 per sec (!), and with collection key, 79 per second.
Anyone got any ideas?
Thanks.
I'm trying to find a collection type with key that offers fast lookup but also can be itterated though in order of insertion. The reason fot this is I am using it as a first in first out object cache. The cache has maybe 30,000 items. I used the dictionary class but this eventualy becomes unstable and crashes as I run out of ram. I tested simple LIST which is better but I must itterate over every item to find my result. Speed is one 3rd of the dictionary. I tried standard collections and keys, but performance is abismal.
So, is there a somthing in between? I cant find anything.
I want to be able to do a quick search for the key and also remove an item that was the oldest in order to add the new item. With an array that's easy. Drop the first, add to the end. Doesn't seem possible with dictionary without storing a value and itterating over all the data.
Performance I got with dict was 1300 per second, with list, 337 per second, with collection, 10 per sec (!), and with collection key, 79 per second.
Anyone got any ideas?
Thanks.