Hello all,

I've created a simple program for measuring malloc() and free() by QueryPerformanceCounter()
in a few byte size like this.

Code:
for (int i = 0; i < 100; i++)
{
QueryPerformanceCounter(&gStart);
p = malloc(size);
free(p);
QueryPerformanceCounter(&gEnd);
printf("%d, %g\n", i, gEnd.QuadPart-gStart.QuadPart);
if (p == NULL)
printf("ERROR\n", size);
}
As a result of measuring this program in both windows 7 and windows 10 in same PC,
I've noticed performance of malloc() and free() in windows 10 is very slower than windows 7.

Below table is 100 time average of malloc() and free() execution time.
bytes for malloc/free windows 7 (sec) windows 10 (sec) windows 10 / 7
1 0.000006553 0.000008245 1.258
100 0.000007092 0.000010218 1.441
1000 0.000009091 0.000012938 1.423
10000 0.000008815 0.000015623 1.772
100000 0.000225812 0.000326278 1.445
1000000 0.000574674 0.000972999 1.693
10000000 0.000391392 0.004254411 10.870
100000000 0.000602178 0.038713946 64.290

In all data size , especially over 10000000 byte, windows 10 is slower than windows 7.

Do you have any suggestions to improve this performance on windows 10?
I believe windows 10 has some switch for this.

Regards,