Steve Dunn · Aug 27, 2021
Optimising Dictionaries that are keyed by a generic Type
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
This short post looks at an implementation of a dictionary that is optimised for keys of generic types. It uses a 'trick' which gives it far better performance than that of a normal Dictionary<Type, TValue> . Using dictionaries that are keyed by a Type is quite common and is often used in 'hot paths', so this optimised lookup could save you precious processing time! I discovered this neat type via…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.