Sometimes I need to check for duplicate identifiers in a set of values, and usually I use a dictionary for this - using only the keys and leaving the values empty.
Please note that this is a tough and highly optimized code, so please don't cry about “premature optimization”! Assuming that the scenarios in which the CPU and RAM are compressed to the limit, I wanted to collect opinions on more optimal solutions; presumably, something like the Lookup class, will avoid unnecessary RAM allocations and thus be a little faster. Are there such classes as a third party, and perhaps some class that I missed in BCL?
I understand that Google has released code for fast and compact classes of dictionaries - maybe there is something there that can be ported to C # /. Net?
Thank.
source
share