I have a windows program I am trying to run under wine, I noticed it runs mush slower under wine.
I can reproduce this behavior in a small demo program. I know this program is not efficient, this is only to make a point.
This program runs at about 18 secs under windows, and 446 secs under wine.
when I run this program natively ( compiled with g++) it takes about 21 seconds, only slightly slower than windows.
Is there a way to improve memory allocation speed under wine?
Are there any additional runtime checks under wine, I can disable?
below is the windows code.
Regards,
Alon.
Code: Select all
#include <windows.h>
#include <omp.h>
#include <vector>
#include <tchar.h>
#define NUM_ALLOC 10000000
int do_work()
{
int size = (rand() % 100)+10;
int ret = 0;
std::vector < std::vector<int>> TempBuffer(size);
for (auto& it : TempBuffer)
it.push_back(rand() % 100);
for (auto& it : TempBuffer)
ret += it[0];
return ret;
}
int main()
{
LARGE_INTEGER t1;
LARGE_INTEGER t2;
LARGE_INTEGER f;
::QueryPerformanceCounter(&t1);
std::vector<int> Alloc(NUM_ALLOC);
#pragma omp parallel for schedule(dynamic,1)
for (int i = 0; i < NUM_ALLOC; i++)
{
Alloc[i]=do_work();
if ((i% (NUM_ALLOC/100))==0)
_tprintf(_T("."));
}
::QueryPerformanceCounter(&t2);
::QueryPerformanceFrequency(&f);
_tprintf(_T("\nAlloc %lf \n"), ((double)(t2.QuadPart - t1.QuadPart)) / (double)f.QuadPart);
}