c# - List of structs vs classes -


i have relatively small dictionary (a few hundred entries @ most) receiving many calls (hundreds, possibly thousands per second) , many of them requires entry modification.

performance wise, 1 of solution recommended small list frequent updates?

  1. unboxing-boxing structs
  2. define structure methods each parameter requires modification
  3. use classes, can directly modified because referenced unlike structures

you should avoid mutable value types (i.e. structures can modified) if @ possible, breaks concept of "value type" if 1 or more attributes of value not intrinsically part of value (and can't changed). if need store values can changed, should using class.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -