I'm porting C++ code from Linux to Windows. During this process, I found out that the following line takes ~10 times slower under Windows (on exactly the same hardware):
list<char*>* item = new list<char*>[160000];
On Windows it takes ~10ms, while on Linux it takes ~1ms. Note that this is the average time. Running this row 100 times takes ~1 second on Windows.
This happens both on win32 and x64, both versions are compiled in Release, and the speed is measured via QueryPerformanceCounter (Windows) and gettimeofday (Linux).
The Linux compiler is gcc. The Windows compiler is VS2010.
Any idea why could this happen?