id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 4780,Many deadline_timer objects triggers worst-case vector reallocation in timer_queue,chris_kohlhoff,chris_kohlhoff,"Using the g++ 4.4.5 on linux x86_64, the following program: {{{ #include boost::asio::io_service io_service; struct timer { boost::asio::deadline_timer t; timer() : t(io_service) {} } timers[100000]; void handler(boost::system::error_code) {} int main() { for (std::size_t i = 0; i < 100000; ++i) { timers[i].t.expires_from_now(boost::posix_time::seconds(1000)); timers[i].t.async_wait(handler); } } }}} takes a very long time to run: {{{ $ time ./a.out real 0m48.504s user 0m21.469s sys 0m27.038s }}} This is due to the vector<>-based heap in asio::detail::timer_queue reserve()-ing one element at a time.",Bugs,closed,To Be Determined,asio,Boost 1.44.0,Problem,fixed,,