Implementing [ ] operator
If you look for performance, you'd better rely on the framework dictionary. You can use the Dictionary&lt;string, List&lt;object&gt;&gt; to do what you need. When you add a new key and value, look if the key already exists. If so, add the value to the array and don't add the key.