|
Boost Users : |
Subject: [Boost-users] Ref: large data sets and BOOST_FOREACH / boost:bind don't mix ?
From: Avi Bahra (avibahra_at_[hidden])
Date: 2010-02-05 12:11:01
You guys were right, I forgot that it was debug release
when run in release mode, I get:
Time: BOOST_FOREACH(Fred& fred, vec) { fred.inc(); } 0.28
Time: std::for_each(vec.begin(),vec.end(),boost::bind(&Fred::inc,_1) ); 0.56
Time: for (std::vector<Fred>::iterator i = vec.begin(); i < theEnd ; i++) {
(*i).inc(); } 0.27
Time: std::for_each(vec.begin();vec.end(),std::mem_fun_ref(&Fred::inc)) 0.6
Time: for (size_t i = 0; i < theSize ; i++) { vec[i].inc(); } 0.27
Best regards,
Ta,
Avi
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net