Форум программистов, компьютерный форум, киберфорум
C/C++: IDE, инструментарий
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
142 / 143 / 64
Регистрация: 11.11.2010
Сообщений: 876
Записей в блоге: 10
1

Профайлер gprof в Code::Blocks

06.06.2017, 14:00. Показов 1143. Ответов 0
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Решаю задачу 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
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
06.06.2017, 14:00
Ответы с готовыми решениями:

Ошибка в Code::Blocks
Скачал я, значит, Code::Blocks на Linux. Создал проект, попытался собрать и запустить. Как итог...

Не запускается code::blocks
При запуске code::blocks на экране возникает следующее сообщение об ошибке. Подскажите пожалуйста,...

Как настроить Code::Blocks?
Ну я подключаю open gl в Code Blocks в include скинул headers файлы lib в lib кинул подключил все...

Code::Blocks - не компилируются программы на C++
Здравствуйте. Есть такая проблема, посоветуйте её решение. В 7 классе изучается программирование в...

0
06.06.2017, 14:00
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
06.06.2017, 14:00
Помогаю со студенческими работами здесь

Code::Blocks 17.12 и MinGW (последний)
Всем привет! Скачал Code::Blocks (codeblocks-17.12mingw-setup.exe), написал простенькую программку...

Создание проектов на C и C++ в Code::Blocks
Несколько удивляет, что в темах по кроссплатформенной разработке (якобы) нет такой отдельной темы...

SFML, MinGW 5.2.0, Code::blocks
В общем решил я собрать SFML сам, потому что не хочу скачивать MinGW 4.9.2 только чтобы...

Не работает компилятор Code Blocks
Здравствуйте! Я перерыл не один форум пытаясь решить эту проблему. И, как мне кажется, тут я...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
1
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru