summaryrefslogtreecommitdiffstats
path: root/libcxx/test/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-11-16 21:33:17 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-11-16 21:33:17 +0000
commit9b35c8275c6e25442915a25648a1b0bade40a43e (patch)
tree5e1d9d88a2243659212c104664332954b4e94f71 /libcxx/test/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
parentfced6e2587dd530b5e35bd48eb67bc0097508a92 (diff)
downloadbcm5719-llvm-9b35c8275c6e25442915a25648a1b0bade40a43e.tar.gz
bcm5719-llvm-9b35c8275c6e25442915a25648a1b0bade40a43e.zip
Dave Zarzycki showed how the efficiency of shared_ptr could be significantly
increased. The following program is running 49% faster: #include <iostream> #include <memory> #include <chrono> #include <vector> #include "chrono_io" int main() { typedef std::chrono::high_resolution_clock Clock; Clock::time_point t0 = Clock::now(); { std::shared_ptr<int> p(new int (1)); std::vector<std::shared_ptr<int> > v(1000000, p); v.insert(v.begin(), p); v.insert(v.begin(), p); v.insert(v.begin(), p); v.insert(v.begin(), p); } Clock::time_point t1 = Clock::now(); std::cout << (t1-t0) << '\n'; } llvm-svn: 119388
Diffstat (limited to 'libcxx/test/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud