I need a fast replacement for the System.Collections.Generic.Dictionary. My application should be really fast. So, the repl
USE INTS AS KEYS FOR MAXIMUM PERFORMANCE:
For anyone who came here from Google, if you want to squeeze every last bit of performance out of a Dictionary, then use Ints as keys. Here's a benchmark comparing Int vs String Keys: https://jacksondunstan.com/articles/2527
The author of the article even mentions that converting strings to ints is worthwhile if you have such a need.
Also, note that this same behavior occurs in some other languages like PHP. Php associative arrays -are in fact- dictionaries, and if you use Ints in ascending order in PHP7, they outperform string keys tremendously.