Click here to Skip to main content
15,889,859 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
In .NET, which data types provide better performance?

Value types
Reference types
Pointer types
Reflexive types
Posted

1 solution

You use the proper data type for the proper job and thats the best performance you can hope for.

Value types typically operate on the stack and since they are primitive types they are "high performance". Reference types are complex types and operate on the heap, typically they are less fast than primitive types but after jit-ing they can be just as fast.

Pointer types are not used by C# unless you are working with unsafe code. The performance depends on what you are doing, they can either be very fast (near primitive) or very slow since the system has to do memory pinning and other unsafe operations.

Reflexive, which I think you mean reflected, are very slow, orders of magnitude slow actually because they cannot be precompiled during runtime.
 
Share this answer
 
Comments
Rahul VB 27-Jan-14 11:33am    
very very very nice sir ctrl + shift + d

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900