更新时间:2022-06-27 05:54:47
你可以在C#在关键瓶颈点使用不安全 C#代码和指针,以使其运行更快。这些行为很像C ++代码,我相信它执行快速
You can use unsafe C# code and pointers in critical bottleneck points to make it run faster. Those behave much like C++ code and I believe it executes as fast.
但是大多数时候,C#是JIT-ted到uber-快速已经,我不相信会有很大的差异,因为每个人都说。
But most of the time, C# is JIT-ted to uber-fast already, I don't believe there will be much differences as with what everyone has said.
但你可能需要考虑的一件事是: (C#)字符串操作比在C ++中有效地使用指针更慢。使用C ++指针比使用CLR字符串有更多的优化技巧。
But one thing you might want to consider is: Managed code (C#) string operations are rather slow compared to using pointers effectively in C++. There are more optimization tricks with C++ pointers than with CLR strings.
我之前做了一些基准测试,但不记得我把它们放在哪里了。
I think I have done some benchmarks before, but can't remember where I've put them.