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?
- unboxing-boxing structs
- define structure methods each parameter requires modification
- 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
Post a Comment