Normally, when init a collection such as Dictionary, if we know how many key-value pairs ahead, we could use
var dict=new Dictionary<>(capacity);