【发布时间】:2018-11-24 13:39:51
【问题描述】:
我一直在使用 gprof 分析我的程序,并注意到顶部附近出现以下内容:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
17.50 6.69 6.69 _mcount_private
12.14 11.33 4.64 __cosl_internal
11.02 15.54 4.21 __sinl_internal
我大量使用 cmath 库中的 cosine 和 sine 函数,因为 cos 和 sin 在这些函数调用的名称中,所以可能就是这些函数。但是,在探查器的下方,我也有
% cumulative self self total
time seconds seconds calls s/call s/call name
2.93 23.25 1.12 cos
2.51 24.21 0.96 sin
这令人困惑,所以我不完全确定 __cosl/sinl_internal 的实际含义。尝试用 Google 搜索该问题时没有得到有意义的结果。
这里是使用的构建命令:
i686-w64-mingw32-g++.exe -Wshadow -Winit-self -Wredundant-decls
-Wcast-align -Wfloat-equal -Wunreachable-code -Wmissing-include-dirs
-pedantic-errors -pedantic -Wall -std=c++14 -fexceptions -O2 -std=c++14
-pg -DSFML_STATIC -std=c++14
【问题讨论】: