79
2018-07-121433603733602008336000 via Android
@yanaraika其实,我不认为写没有定义行为的代码是个问题。 不能说是严重的问题。
我们使用这个代码已经10多年了。 很多东西都是直接从静态库中分发的。 能做O3的部分早就变成了O3。
历史的重担重重。 你想不到的兄弟。 这样下去,在上边还讨厌需求开发的缓慢。 本来O2会跑,为了一点虚无的性能,你必须换成O3。 在线上炸了。 这个责任由谁来承担? 爆破的这部分代码和你没有任何关系吗? O2加上特殊代码的写法,就能达到我们所要求的性能。 为什么需要改变?
因为O3并不一定能提高性能,所以贴上一句话:
- O3 hasseveraldisadvantages :
firstofallitoftenproducesslowercodethan-o2or-OS.sometimesitproduceslongercodeduetoloopunrollingwhichmaybeinfactslowerdue
asitwassaiditsometimesproduceswrongcode.itmaybeeitherduetoerrorinoptimalizationorerrorincode (likeignoringstrictaliasing ) . askernelcodesometimesisandsometimeshavetobe ' smart ' I ' dsayitispossiblethatsomekerneldevelopermadesomeeerrror.iexperiencencer likecrashingofuserspaceutilities,whenicompiledkernelwithgcc 4.5 whichatthatpointwasstable.istillusegcc 4.4 forkernelandseveralal
id on ' tthinkitoffersmuchbenefitforthelinuxkernel.thekerneldoesnotdoheavycomputationsandinplacesitdoes, itisoptimizedwithassembly.- O3 flagwillnotchangethecostofcontextswitchingorspeedofi/o.id on ' tthinksomethinglike 0.1 % speed
只要稳定,性能不差,O2就无所谓。
收集不到可靠的人,兄弟,并不是说这十几年每个人都能写全定义的代码,如果每个人都是,做点什么测试,直接发布就行了。
理想很丰满呢。