Why does JavaScript appear to be 4 times faster than C++?

前端 未结 5 1850
长发绾君心
长发绾君心 2021-01-29 22:42

For a long time, I had thought of C++ being faster than JavaScript. However, today I made a benchmark script to compare the speed of floating point calculations in the two langu

5条回答
  •  不要未来只要你来
    2021-01-29 23:28

    JS of any popular runtime is compiled in C++, so like you probably can't get it to run faster than equivalent native code ... you can prove it by induction by counting from 1 by 1 to google if you want

提交回复
热议问题