我们设置了两个相同的HP Z840工作站,其规格如下
并在每个上安装了Windows 7 SP1(x64)和Windows 10 Creators Update(x64).
然后我们运行了一个小内存基准测试(下面的代码,使用VS2015 Update 3,64位架构构建),它可以同时从多个线程执行内存分配 - 无填充.
#include <Windows.h>
#include <vector>
#include <ppl.h>
unsigned __int64 ZQueryPerformanceCounter()
{
unsigned __int64 c;
::QueryPerformanceCounter((LARGE_INTEGER *)&c);
return c;
}
unsigned __int64 ZQueryPerformanceFrequency()
{
unsigned __int64 c;
::QueryPerformanceFrequency((LARGE_INTEGER *)&c);
return c;
}
class CZPerfCounter {
public:
CZPerfCounter() : m_st(ZQueryPerformanceCounter()) {};
void reset() { m_st = ZQueryPerformanceCounter(); };
unsigned __int64 elapsedCount() { return ZQueryPerformanceCounter() - m_st; }; …
Run Code Online (Sandbox Code Playgroud) windows memory-management windows-7 windows-10 windows-server-2016