Benchmarking RAM performance - UWP and C#

我们两清 提交于 2019-12-24 03:48:06

问题


I'm developing a benchmarking application using Universal Windows Platform that evaluates CPU and RAM performance of a Windows 10 system.

Although I found different algorithms to benchmark a CPU, I still didn't found any solid algorithm or solution to evaluate the write and read speeds of memory.

How can I achieve this in C#?

Thanks in advance :)


回答1:


I don't see why this would not be possible from managed code. Array access code turns into normal x86 memory instructions. It's a thin abstraction. In particular I don't see why you would need a customized OS.

You should be able to test sequential memory speed by performing memcpy on big arrays. They must be bigger than the last level cache size.

You can test random access by randomly indexing into a big array. The index calculation must be cheap, unpredictable and there must be a dependency chain that serializes the memory instructions so that the CPU cannot parallelize them.

Honestly I don't think its possible. RAM benchmarks usually run off of dedicated OS's

RAM testing is different from RAM benchmarking.

C# doesn't give you that kind of control over RAM

Of course, just new up a big array and access it. Also, understand the overheads that are present. The only overhead is a range check.

The GC has no impact during the benchmark. It might be triggered by an allocation.



来源:https://stackoverflow.com/questions/32763841/benchmarking-ram-performance-uwp-and-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!