Interpreting gprof output with <spontaneous>

I am trying to find a performance problem in my program and thus tied the code to profiling. gprof creates a flat profile as follows:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 27.97      4.10     4.10                             std::_Deque_iterator<char, char&, char*>::_Deque_iterator(std::_Deque_iterator<char, char&, char*> const&)
  6.96      5.12     1.02                             std::_Deque_iterator<char, char&, char*>::difference_type std::operator-<char, char&, char*>(std::_Deque_iterator<char, char&, char*> const&, std::_Deque_iterator<char, char&, char*> const&)
  5.12      5.87     0.75                             std::__deque_buf_size(unsigned int)
  4.23      6.49     0.62                             std::_Deque_iterator<char, char&, char*>::operator+=(int)
  3.41      6.99     0.50                             std::deque<char, std::allocator<char> >::begin()
  1.91      7.27     0.28     7896     0.04     0.04  std::vector<MyClass, std::allocator<MyClass> >::_M_insert_aux(__gnu_cxx::__normal_iterator<MyClass*, std::vector<MyClass, MyClasst> > >, MyClassconst&)
  1.91      7.55     0.28                             std::deque<char, std::allocator<char> >::size() const
  1.91      7.83     0.28                             std::_Deque_iterator<char, char&, char*>::_S_buffer_size()

followed by many lines with less time.

First question: is it really an assumption to believe that there is a problem with std :: deque? The problem is that I know that we use std :: deque, but I do not know about using with <char>.

If this assumption is true, it seems to make sense to look at the call stack and see where this deque is used. All entries related to things deque<char>are called only <spontaneous>!

Just one example:

index % time    self  children    called     name
                                                 <spontaneous>
[1]     28.0    4.10    0.00                 std::_Deque_iterator<char, char&, char*>::_Deque_iterator(std::_Deque_iterator<char, char&, char*> const&) [1]

Is there any way to know more about this deque?

Thanks for any tips!

+5
1

-, - , gprof, . -pg (, ?). , , . , , .

+2

All Articles