What makes PHP slower than Java or C#?

后端 未结 8 844
耶瑟儿~
耶瑟儿~ 2020-12-14 16:10

This is something I\'ve always wondered: Why is PHP slower than Java or C#, if all 3 of these languages get compiled down to bytecode and then executed from there? I know th

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 16:26

    Both Java and C# have JIT compilers, which take the bytecode and compile into true machine code. The act of compiling it can take time, hence C# and Java can suffer from slower startup times, but once the code is JIT compiled, its performance is in the same ballpark as any "truly compiled" language like C++.

提交回复
热议问题