请注意,我的问题不是:我如何告诉我的编译器在开启分析的情况下进行编译。
我想配置我的编译过程。对于每个文件,我想知道程序的每一行花费了多少时间。
我正在处理一个项目,有些文件的编译时间很长,我正在尝试找出原因。
有没有办法用 g++ 或 llvm-clang 做到这一点?
谢谢!
-v -ftime-report 的输出(什么意思)?
下面是“解析器”还是“扩展”模板的使用?
Execution times (seconds)
callgraph construction: 0.06 ( 2%) usr 0.00 ( 0%) sys 0.09 ( 2%) wall 3181 kB ( 1%) ggc
callgraph optimization: 0.05 ( 2%) usr 0.00 ( 0%) sys 0.05 ( 1%) wall 5243 kB ( 2%) ggc
cfg cleanup : 0.02 ( 1%) usr 0.00 ( 0%) sys 0.02 ( 0%) wall 11 kB ( 0%) ggc
df live regs : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall 0 kB ( 0%) ggc
df reg dead/unused notes: 0.03 ( 1%) usr 0.00 ( 0%) sys 0.03 ( 1%) wall 1993 kB ( 1%) ggc
register information : 0.04 ( 1%) usr 0.00 ( 0%) sys 0.04 ( 1%) wall 0 kB ( 0%) ggc
alias analysis : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall 450 kB ( 0%) ggc
rebuild jump labels : 0.03 ( 1%) usr 0.00 ( 0%) sys 0.03 ( 1%) wall 0 kB ( 0%) ggc
preprocessing : 0.12 ( 4%) usr 0.06 (12%) sys 1.46 (27%) wall 2752 kB ( 1%) ggc
parser : 0.67 (21%) usr 0.15 (29%) sys 0.89 (16%) wall 91749 kB (36%) ggc
name lookup : 0.15 ( 5%) usr 0.12 (24%) sys 0.24 ( 4%) wall 14384 kB ( 6%) ggc
inline heuristics : 0.03 ( 1%) usr 0.00 ( 0%) sys 0.03 ( 1%) wall 0 kB ( 0%) ggc
tree gimplify : 0.06 ( 2%) usr 0.01 ( 2%) sys 0.09 ( 2%) wall 15992 kB ( 6%) ggc
tree eh : 0.02 ( 1%) usr 0.01 ( 2%) sys 0.03 ( 1%) wall 4405 kB ( 2%) ggc
tree CFG construction : 0.01 ( 0%) usr 0.01 ( 2%) sys 0.03 ( 1%) wall 6636 kB ( 3%) ggc
tree CFG cleanup : 0.02 ( 1%) usr 0.01 ( 2%) sys 0.02 ( 0%) wall 15 kB ( 0%) ggc
tree find ref. vars : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall 1870 kB ( 1%) ggc
tree SSA rewrite : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall 2357 kB ( 1%) ggc
tree SSA other : 0.00 ( 0%) usr 0.01 ( 2%) sys 0.00 ( 0%) wall 37 kB ( 0%) ggc
tree operand scan : 0.01 ( 0%) usr 0.04 ( 8%) sys 0.06 ( 1%) wall 6340 kB ( 2%) ggc
tree SSA to normal : 0.05 ( 2%) usr 0.00 ( 0%) sys 0.05 ( 1%) wall 95 kB ( 0%) ggc
dominance computation : 0.04 ( 1%) usr 0.00 ( 0%) sys 0.04 ( 1%) wall 0 kB ( 0%) ggc
expand : 0.60 (18%) usr 0.03 ( 6%) sys 0.71 (13%) wall 45557 kB (18%) ggc
varconst : 0.02 ( 1%) usr 0.00 ( 0%) sys 0.02 ( 0%) wall 3532 kB ( 1%) ggc
jump : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall 1745 kB ( 1%) ggc
mode switching : 0.01 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 0%) wall 0 kB ( 0%) ggc
integrated RA : 0.35 (11%) usr 0.00 ( 0%) sys 0.35 ( 6%) wall 5259 kB ( 2%) ggc
reload : 0.29 ( 9%) usr 0.01 ( 2%) sys 0.31 ( 6%) wall 6490 kB ( 3%) ggc
thread pro- & epilogue: 0.10 ( 3%) usr 0.01 ( 2%) sys 0.13 ( 2%) wall 4832 kB ( 2%) ggc
final : 0.19 ( 6%) usr 0.01 ( 2%) sys 0.21 ( 4%) wall 2985 kB ( 1%) ggc
symout : 0.25 ( 8%) usr 0.01 ( 2%) sys 0.26 ( 5%) wall 27322 kB (11%) ggc
TOTAL : 3.25 0.51 5.49 256741 kB
最佳答案
用 g++ 试试这些命令行选项
-v -ftime-report
这应该会为您提供有关编译过程的更多信息。罪魁祸首通常是模板。
关于c++ g++ llvm-clang 编译器分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2542273/
我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server
我不知道为什么,但是当我设置这个设置时它无法编译设置:static_cache_control,[:public,:max_age=>300]这是我得到的syntaxerror,unexpectedtASSOC,expecting']'(SyntaxError)set:static_cache_control,[:public,:max_age=>300]^我只想将“过期”header设置为css、javaascript和图像文件。谢谢。 最佳答案 我猜您使用的是Ruby1.8.7。Sinatra文档中显示的语法似乎是在Ruby1.
如何将send与+=一起使用?a=20;a.send"+=",10undefinedmethod`+='for20:Fixnuma=20;a+=10=>30 最佳答案 恐怕你不能。+=不是方法,而是语法糖。参见http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html它说Incommonwithmanyotherlanguages,Rubyhasasyntacticshortcut:a=a+2maybewrittenasa+=2.你能做的最好的事情是:
最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路
我对如何计算通过{%assignvar=0%}赋值的变量加一完全感到困惑。这应该是最简单的任务。到目前为止,这是我尝试过的:{%assignamount=0%}{%forvariantinproduct.variants%}{%assignamount=amount+1%}{%endfor%}Amount:{{amount}}结果总是0。也许我忽略了一些明显的东西。也许有更好的方法。我想要存档的只是获取运行的迭代次数。 最佳答案 因为{{incrementamount}}将输出您的变量值并且不会影响{%assign%}定义的变量,我
我有一个数组数组,想将元素附加到子数组。+=做我想做的,但我想了解为什么push不做。我期望的行为(并与+=一起工作):b=Array.new(3,[])b[0]+=["apple"]b[1]+=["orange"]b[2]+=["frog"]b=>[["苹果"],["橙子"],["Frog"]]通过推送,我将推送的元素附加到每个子数组(为什么?):a=Array.new(3,[])a[0].push("apple")a[1].push("orange")a[2].push("frog")a=>[[“苹果”、“橙子”、“Frog”]、[“苹果”、“橙子”、“Frog”]、[“苹果”、“
有没有办法让Ruby能够做这样的事情?classPlane@moved=0@x=0defx+=(v)#thisiserror@x+=v@moved+=1enddefto_s"moved#{@moved}times,currentxis#{@x}"endendplane=Plane.newplane.x+=5plane.x+=10putsplane.to_s#moved2times,currentxis15 最佳答案 您不能在Ruby中覆盖复合赋值运算符。任务在内部处理。您应该覆盖+,而不是+=。plane.a+=b与plane.a=
是否有适用于Ruby语言的.NETFramework编译器?我听说过DLR(动态语言运行时),这是否将使Ruby能够用于.NET开发? 最佳答案 IronRuby是Microsoft支持的项目,建立在动态语言运行时之上。 关于.net-是否有Ruby.NET编译器?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/199638/
出于某种原因,heroku尝试要求dm-sqlite-adapter,即使它应该在这里使用Postgres。请注意,这发生在我打开任何URL时-而不是在gitpush本身期间。我构建了一个默认的Facebook应用程序。gem文件:source:gemcuttergem"foreman"gem"sinatra"gem"mogli"gem"json"gem"httparty"gem"thin"gem"data_mapper"gem"heroku"group:productiondogem"pg"gem"dm-postgres-adapter"endgroup:development,:t
我是Ruby和这个网站的新手。下面两个函数是不同的,一个在函数外修改变量,一个不修改。defm1(x)x我想确保我理解正确-当调用m1时,对str的引用被复制并传递给将其视为x的函数。运算符当调用m2时,对str的引用被复制并传递给将其视为x的函数。运算符+创建一个新字符串,赋值x=x+"4"只是将x重定向到新字符串,而原始str变量保持不变。对吧?谢谢 最佳答案 String#+::str+other_str→new_strConcatenation—ReturnsanewStringcontainingother_strconc