Thursday 15 January 2015

performance - C#: Are struct members more performant? -


About the idea about the member field of Structure vs. Classes:

Reason To use a structure, do not assign an additional object to the stack. It allows to keep this solution as 'executable', such that the class is coded in the field

First of all, it does not mean that piles ?

And, will not the use of strontaks be used to decrease the time of allocation (especially if members of the class are lazy-loaded) at the cost of increasing the memory footprint?

Do you recommend this practice of strokes on classes in certain circumstances?

"post-text" itemprop = "text">

I think that was meant to write that pile, it was just accidentally written a heap.

The question of the strokes or class often comes up here is one. I think it is best to follow this generally given advice:


MSDN answers ..

Actually, that page gives you a 4-item checklist and a class until your type does not meet all the criteria.

Do not define a structure unless the type has all of the following features:

  * It represents a single value of rational, similar to primitive types ( Integer, double, and so on) * It has smaller size than 16 bytes. * It is irreversible * It will not have to be boxed repeatedly.  

Should not you follow this advice? Maybe, but only after proving it through your profile.


No comments:

Post a Comment