Help with explaining profiler results [STL]
I'm profiling a recent program that is dominated with File read. I'm kind of confused on how to interpret the results. If someone could explain to me what these top four functions are, it would help me a lot. Thanks in advance!
% cumulative self self total
time seconds seconds calls ms/call ms/call name
25.00 0.95 0.95 _Unwind_SjLj_Register
15.79 1.55 0.60 开发者_如何学编程 std::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > >::_M_extract_float(std::istreambuf_iterator<char, std::char_traits<char> >, std::istreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, std::_Ios_Iostate&, std::string&) const
10.26 1.94 0.39 std::string::_M_mutate(unsigned int, unsigned int, unsigned int)
10.00 2.32 0.38 _Unwind_SjLj_Unregister
The first and last are for exception handling; they are generated by the compiler to register objects whose destructors must be called if an exception leaves the current scope. You might be able to avoid calls to these functions if you can restructure your code to avoid throwing exceptions, or calling functions that might throw, during the lifetime of objects with non-trivial destructors. This often isn't possible, though.
The second is the internal function for parsing a float
value from an input stream.
The third is the internal function for resizing a string, perhaps one used internally when parsing the stream.
num_get is used in the conversion from strings t numbers, and the mutate function I would guess is somehow changing the size of a string. so I would guess your program is reading strings and converting them into numbers. The Unwind stuff I would guess is something to do with exception handling. Can't say more without seeing code.
精彩评论