What makes PHP slower than Java or C#?

后端 未结 8 802
耶瑟儿~
耶瑟儿~ 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:31

    The biggest single reason is that Java's HotSpot JVM and C#'s CLR both use Just-In-Time (JIT) compilation. JIT compilation compiles the bytecodes down to native code that runs directly on the processor.

    Also I think Java bytecode and CIL are lower-level than PHP's internal bytecode which might make alot of JIT optimizations easier and more effective.

提交回复
热议问题