Hello folks, we've found a performance bottleneck searching for items in a
large in-memory collection. Most of the code was converted from 15+ year
old C++ code into C# so a lot of weird looking stuff came across. There are
lots of sequential searches for items in arrays and List<> which have
complexity O(n) and get really slow for large collections. I previously
converted one bottleneck List<> into a Dictionary<> and it was a miracle
cure, but it was a simple case with one property value being a unique key.

The next bottleneck collection needs to be searched efficiently on
different property values, and I'm wondering if anyone knows of a
collection which supports multiple indexes (possibly non-unique).

An in-memory SQLite table with multiple indexes would do the job, but it's
a bit heavyweight and like hammering a screw. Using multiple Dictionaries
or Sets to index the same objects won't work due to non-unique values.
Maybe there is some lightweight package around for this sort of thing? It's
a classic computer science problem.

*Greg Keogh*
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Reply via email to