1 | |
Профайлер gprof в Code::Blocks06.06.2017, 14:00. Показов 1143. Ответов 0
Метки нет (Все метки)
Решаю задачу 82B - Множества c codeforces.com.
Первые 20 тестов прошёл, но дальше - превышение времени. Решил посмотреть, что же оптимизировать, вспомнил слово "профайлер". Оказывается, в Code::Blocks есть встроенный профайлер gprof. Вот его вывод. Код
Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls us/call us/call name 44.81 4.66 4.66 _mcount_private 33.17 8.11 3.45 __fentry__ 2.79 8.40 0.29 18591950 0.02 0.02 std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::end() const 1.63 8.57 0.17 33358989 0.01 0.01 std::_Rb_tree_const_iterator<int>::operator!=(std::_Rb_tree_const_iterator<int> const&) const 1.54 8.73 0.16 36422032 0.00 0.00 std::_Rb_tree_const_iterator<int>::_Rb_tree_const_iterator(std::_Rb_tree_node_base const*) 1.35 8.87 0.14 8162389 0.02 0.05 bool std::__lexicographical_compare_impl<std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, __gnu_cxx::__ops::_Iter_less_iter>(std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, __gnu_cxx::__ops::_Iter_less_iter) 1.15 8.99 0.12 749700 0.16 1.94 std::_Rb_tree<std::set<int, std::less<int>, std::allocator<int> >, std::set<int, std::less<int>, std::allocator<int> >, std::_Identity<std::set<int, std::less<int>, std::allocator<int> > >, std::less<std::set<int, std::less<int>, std::allocator<int> > >, std::allocator<std::set<int, std::less<int>, std::allocator<int> > > >::_M_get_insert_unique_pos(std::set<int, std::less<int>, std::allocator<int> > const&) 1.15 9.11 0.12 749700 0.16 0.83 std::insert_iterator<std::set<int, std::less<int>, std::allocator<int> > > std::__set_intersection<std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::insert_iterator<std::set<int, std::less<int>, std::allocator<int> > >, __gnu_cxx::__ops::_Iter_less_iter>(std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::insert_iterator<std::set<int, std::less<int>, std::allocator<int> > >, __gnu_cxx::__ops::_Iter_less_iter) 0.96 9.21 0.10 27664941 0.00 0.01 std::_Rb_tree_const_iterator<int>::operator*() const 0.87 9.30 0.09 13760719 0.01 0.03 bool __gnu_cxx::__ops::_Iter_less_iter::operator()<std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int> >(std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>) const 0.87 9.39 0.09 8837770 0.01 0.01 std::_Rb_tree_const_iterator<int>::operator++() 0.87 9.48 0.09 8162389 0.01 0.14 bool std::operator< <int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >(std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> > const&, std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> > const&) 0.67 9.55 0.07 27709493 0.00 0.00 __gnu_cxx::__aligned_membuf<int>::_M_addr() const 0.58 9.61 0.06 32649556 0.00 0.00 std::_Rb_tree_const_iterator<int> std::__niter_base<std::_Rb_tree_const_iterator<int> >(std::_Rb_tree_const_iterator<int>) 0.58 9.67 0.06 27709493 0.00 0.01 std::_Rb_tree_node<int>::_M_valptr() const 0.58 9.73 0.06 8162389 0.01 0.06 bool std::__lexicographical_compare<false>::__lc<std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int> >(std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>) 0.58 9.79 0.06 7216184 0.01 0.01 std::_Rb_tree_const_iterator<int>::operator==(std::_Rb_tree_const_iterator<int> const&) const 0.48 9.84 0.05 17830082 0.00 0.01 std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::begin() const 0.38 9.88 0.04 27709493 0.00 0.00 __gnu_cxx::__aligned_membuf<int>::_M_ptr() const 0.38 9.92 0.04 8912089 0.00 0.00 __gnu_cxx::__ops::__iter_less_iter() 0.38 9.96 0.04 8162389 0.00 0.00 std::_Rb_tree_const_iterator<int> std::__lc_rai<std::bidirectional_iterator_tag, std::bidirectional_iterator_tag>::__newlast1<std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int> >(std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>) 0.38 10.00 0.04 8162389 0.00 0.07 bool std::__lexicographical_compare_aux<std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int> >(std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>, std::_Rb_tree_const_iterator<int>) 0.38 10.04 0.04 8162389 0.00 0.15 bool std::operator< <int, std::less<int>, std::allocator<int> >(std::set<int, std::less<int>, std::allocator<int> > const&, std::set<int, std::less<int>, std::allocator<int> > const&) 0.29 10.07 0.03 749700 0.04 1.99 std::pair<std::_Rb_tree_iterator<std::set<int, std::less<int>, std::allocator<int> > >, bool> std::_Rb_tree<std::set<int, std::less<int>, std::allocator<int> >, std::set<int, std::less<int>, std::allocator<int> >, std::_Identity<std::set<int, std::less<int>, std::allocator<int> > >, std::less<std::set<int, std::less<int>, std::allocator<int> > >, std::allocator<std::set<int, std::less<int>, std::allocator<int> > > >::_M_insert_unique<std::set<int, std::less<int>, std::allocator<int> > >(std::set<int, std::less<int>, std::allocator<int> >&&) ... _mcount_private и __fentry__ . Насколько я гуглил - это части самого профайлера, но как избавиться от их учёта, непонятно.Я запускал программу без профайлера (без ключа "-pg") - исполняется примерно столько же времени, что и с ним. Подскажите, как получить результат профайлера без этих _mcount_private и __fentry__ .
0
|
06.06.2017, 14:00 | |
Ответы с готовыми решениями:
0
Ошибка в Code::Blocks Не запускается code::blocks Как настроить Code::Blocks? Code::Blocks - не компилируются программы на C++ |
06.06.2017, 14:00 | |
06.06.2017, 14:00 | |
Помогаю со студенческими работами здесь
1
Code::Blocks 17.12 и MinGW (последний) Создание проектов на C и C++ в Code::Blocks SFML, MinGW 5.2.0, Code::blocks Не работает компилятор Code Blocks Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |