If you assume that you are initializing the dictionary, and then it remains read-only, then using a simple dictionary is great and will not have a bottleneck because it is not thread safe and therefore there is no synchronization overhead.
If you really support a read-only template, I would suggest encapsulating your dictionary in a container type class that supports read operations. Then your customers may not undermine your design intent, "wrote" to the dictionary.
source share