IDictionary or NameValueCollection

后端 未结 4 1739
南笙
南笙 2021-01-01 09:59

I have a scenario where-in I can use either NameValueCollection or IDictionary. But I would like to know which one will be better performance-wise.

-- Using NameValu

4条回答
  •  离开以前
    2021-01-01 10:10

    I agree with fatcat and lomaxx (and up-voted for both answers). I would add that performance of collection types should most likely be the last consideration when choosing between collection types. Use the type that most fits your usage needs. If you are in a performance critical section of code (and most likely, you're not), then the only answer is to measure each case - don't believe the Interweb, believe the numbers.

提交回复
热议问题