0

I have captured the gprof profiler output while running a c++ program. I got below logs I found that there are two functions which are consuming most time ie receiveXappMessages and load() function. I can find the function receiveXappMessages() in my c++ code, but do not see load() function used anywhere. What could be the reason why I do no see load() function used. Is this because load() is not called directly in my code, instead it was used via any dependent library? Can anyone explain this?

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 50.00      0.01     0.01       17     0.59     0.59  receiveXappMessages(mapWrapper*, mapWrapper*, RmrMessagesBuffer&, timespec&)
 50.00      0.02     0.01                             std::atomic<double>::load(std::memory_order) const
  0.00      0.02     0.00     1750     0.00     0.00  overrun_encoder_cb
  0.00      0.02     0.00      527     0.00     0.00  catch_function(int)
  0.00      0.02     0.00      432     0.00     0.00  std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~pair()
  0.00      0.02     0.00      345     0.00     0.00  monitor_loglevel_change_handler(void*)
  0.00      0.02     0.00      283     0.00     0.00  _print2fp

my code link is sctpThread.cpp

  • if you do not show your code, nobody can see where `load` is called. Please post a [mcve] – 463035818_is_not_an_ai Jul 17 '23 at 14:04
  • Added the source code link. it is a single c++ file. – myquest9 sh Jul 17 '23 at 15:26
  • I tried to compile/run your code so I could show you how to find performance problems, but "3rdparty" and "scptThread.h" were missing. In any case, people still waste their time with `gprof`. [*Here's*](https://stackoverflow.com/a/378024/23771) the method I rely on. – Mike Dunlavey Jul 17 '23 at 16:20

0 Answers0