From Eric Lippert's blog The truth about value types it is clear that the number of registers may have a major impact on code performance. What are the criterias of code that benefits the most from the higher register count in x64 systems? Are there any good examples?
It is clear to me that the register count is not the only and not even the most important aspect of a x64 platform, but if there are such criterias, should the platform that we plan to run our code on have an impact on how we write our code?
The short answer to your question is definitely - no.
The biggest benefit when programming in C# (or Java) is that you do not need to worry about things like storage location or unclean pointers.
The CLR is not designed for real-time applications anyway or in other words to give you that type of control over the hardware, it is designed to be a rapid application development tool and that is where its force is - of course in the price of not being able to control the low level behaviors.
There are no coding criteria to benefit from in general but there are exceptions such as using string builder instead of writing string_Result=string_X+string_Y+string_Z in an iteration.
but this is more related to correct coding or optimized coding regardless of CLI or C#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With