[Bug c++/58437] Sorting value in reverse order is much slower compare to gcc44

2013-09-16 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58437 Paolo Carlini changed: What|Removed |Added CC||jmbnyc at gmail dot com --- Comment #5 fr

[Bug c++/58437] Sorting value in reverse order is much slower compare to gcc44

2013-09-16 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58437 Paolo Carlini changed: What|Removed |Added CC||chris at bubblescope dot net --- Comment

[Bug c++/58437] Sorting value in reverse order is much slower compare to gcc44

2013-09-16 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58437 --- Comment #1 from Marc Glisse --- I can't reproduce this. I tried compiling with -O3 (with 4.4, 4.7 and 4.8) after commenting out either of the 2 sort lines, and I see roughly the same execution times (maybe a few % difference, but nowhere near

[Bug c++/58437] Sorting value in reverse order is much slower compare to gcc44

2013-09-16 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58437 --- Comment #3 from Marc Glisse --- Less confusing testcase: #include #include using namespace std; int main() { const int num = 1000; vector v; v.reserve(num); for(int i=0;i!=num;++i) v.push_back(-i); sort(v.begin(), v.end()); }

[Bug c++/58437] Sorting value in reverse order is much slower compare to gcc44

2013-09-16 Thread glisse at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58437 --- Comment #2 from Marc Glisse --- Ah forget my last message, I understand now you are really interested in how long it takes to reverse-sort an already sorted vector. Indeed it does take much longer with 4.6+ than with 4.4.