帮助解释分析器结果 [STL]

发布于 2024-09-13 22:05:36 字数 876 浏览 3 评论 0原文

我正在分析一个最近的程序,该程序以文件读取为主。我对如何解释结果有点困惑。如果有人可以向我解释这四个功能是什么,那将对我有很大帮助。提前致谢!

  %   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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

走野 2024-09-20 22:05:36

第一个和最后一个用于异常处理;它们由编译器生成,用于注册对象,如果异常离开当前范围,则必须调用其析构函数。如果您可以重构代码以避免在具有重要析构函数的对象的生命周期内引发异常或调用可能引发异常的函数,则可以避免调用这些函数。但这通常是不可能的。

第二个是用于从输入流解析浮点值的内部函数。

第三个是用于调整字符串大小的内部函数,可能是在解析流时在内部使用的函数。

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.

青丝拂面 2024-09-20 22:05:36

num_get 用于从字符串 t 数字进行转换,我猜想 mutate 函数会以某种方式改变字符串的大小。所以我猜你的程序正在读取字符串并将它们转换为数字。我猜想 Unwind 的内容与异常处理有关。没有看到代码就不能说更多。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文