最高第 3 名 现在第 5 名
论语言性能基准偏差
开发者称语言性能对比常因次优代码而严重失真,多数基准无用,需懂语言与硬件才能写出极限性能代码。
要点
- @theredpix 为测试发布了一个 C++ 版本,并称其比 @axeng200 改进后的 C# 版本快 1.78 倍。
- @theredpix 表示,信息流中称 C# 比 C++/C 更快的帖子让其有些恼火。
- @SebAaltonen 认为语言性能对比往往存在严重偏差,且大多数基准测试的代码不够优化,因而毫无用处。
要点和反应摘要由 AI 依据本页推文整理,请以原推为准。 我们怎么用 AI
原推
Language performance comparisons are often heavily biased. So easy to make 10x+ slower code on pretty much every language. Have to understand the language and the hardware to make speed-of-light code. Most benchmarks have sub-optimal code, making them useless.引用 @theredpix: Actually, it should be #cpp
I read some posts on my feed saying that C# was faster than C++/C.
It got me a little annoyed.
So decided to pop a proper C++ version for the test; here are the results:
The C++ implementation here is
1.78x faster than the improved C# one by @axeng200
#programming #csharp #gamedev #screenshotSaturday #ComputerScience
讨论 0
注册 登录 后参与讨论
还没有人讨论,来说第一句。