开发者

Which scenarios maximize the performance impact of the higher register count in an x64 system for C# code?

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 开发者_StackOverflow社区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#.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜