[code=cpp]
#include <list>
int main()
{
std::list<int> lst;
for(int i=0; i<1000; i++)
{
for(int x=0; x<5000; x++)
lst.push_back(x );
lst.clear();
}
return 0;
}[/code]
I compiled this code on VC8 (Release version ) and Cygwin G++ 3.4.4 and compare the result :
$time test_gcc
real 0m13.100s
user 0m13.077s
sys 0m0.031s
$time test_vc
real 0m3.552s
user 0m0.031s
sys 0m0.015s
why the difference is so far?
#include <list>
int main()
{
std::list<int> lst;
for(int i=0; i<1000; i++)
{
for(int x=0; x<5000; x++)
lst.push_back(x );
lst.clear();
}
return 0;
}[/code]
I compiled this code on VC8 (Release version ) and Cygwin G++ 3.4.4 and compare the result :
$time test_gcc
real 0m13.100s
user 0m13.077s
sys 0m0.031s
$time test_vc
real 0m3.552s
user 0m0.031s
sys 0m0.015s
why the difference is so far?
Comment