Why Java is running faster than C here?

后端 未结 9 710
甜味超标
甜味超标 2021-01-02 11:55

Inspired by this question,

Now visible only for users with > 10k rep

I came up with the following code:

$cat loop.c 
int main(          


        
9条回答
  •  离开以前
    2021-01-02 12:34

    I don't think this question really has an answer; it depends on the optimizations both compilers perform. In this case I expect either, if poked into sufficient optimization effort, would eliminate the loop entirely as i is never used.

提交回复
热议问题