什么是_Unwind_SjLj_Unregister和_Unwind_SjLj_Register?

cal*_*pto 6 c++ profile gprof

什么是_Unwind_SjLj_Unregister和_Unwind_SjLj_Register?我在gprof报告中将它们作为我的顶级处理器时间用户.谷歌只返回抱怨这两个错误的人的链接.

这是我报告中唯一有时间的部分!= 0:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 33.33      0.03     0.03                             _Unwind_SjLj_Unregister
 22.22      0.05     0.02                             _Unwind_SjLj_Register
 11.11      0.06     0.01    13886     0.00     0.00  toint(std::string, int)
 11.11      0.07     0.01     4380     0.00     0.00  hexlify(std::string)
 11.11      0.08     0.01     2994     0.00     0.00  std::_Deque_iterator<unsigned char, unsigned char const&, unsigned char const*>::operator+(int) const
 11.11      0.09     0.01                             std::string::assign(char const*, unsigned int)
Run Code Online (Sandbox Code Playgroud)

我正在运行Windows 7 x64,并使用代码块10.05 gcc进行编译

编辑:

启用强制程序运行64秒的函数后,它现在看起来像:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
  8.45      3.49     3.49                             _Unwind_SjLj_Register
  7.36      6.53     3.04  4000006     0.00     0.00  CAST128::setkey(std::string)
  5.86      8.95     2.42                             _Unwind_SjLj_Unregister
  4.36     10.75     1.80 64000080     0.00     0.00  CAST128::F(int&, unsigned int&, unsigned int&, unsigned char&)
  3.68     12.27     1.52                             __dynamic_cast
  3.37     13.66     1.39                             std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&)
  3.25     15.00     1.34                             std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
  2.88     16.19     1.19                             std::istreambuf_iterator<char, std::char_traits<char> > std::num_get<char, std::istreambuf_iterator<char, std::char_traits<char> > >::_M_extract_int<unsigned long long>(std::istreambuf_iterator<char, std::char_traits<char> >, std::istreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, std::_Ios_Iostate&, unsigned long long&) const
Run Code Online (Sandbox Code Playgroud)

tot*_*two 4

我相信这是异常处理。当人们尝试链接到在不同编译器中构建的 C++ 库时,大多数问题都会出现。

  • 唔。令人有点惊讶的是,您的程序将 55% 的时间用在异常处理程序上。但让我们更逻辑地思考一下:我注意到您的个人资料准确测量了 0.03 秒和 0.02 秒。其他一切都需要 0.01 秒。看起来该程序几乎没有花费任何时间来运行,并且探查器无法以小于 0.01 秒的粒度测量任何内容。您需要更长的运行才能获得任何有意义的信息。你基本上是看着六粒沙子,其中两粒比其他的大一点,并试图弄清楚如何清理海滩。 (2认同)