Why are JIT-ed languages still slower and less memory efficient than native C/C++?

Some reasons for differences;

  • JIT compilers mostly compile quickly and skip some optimizations that take longer to find.

  • VM's often enforce safety and this slows execution. E.g. Array access is always bounds checked in .Net unless guaranteed within the correct range

  • Using SSE (great for performance if applicable) is easy from C++ and hard from current VM's

  • Performance gets more priority in C++ over other aspects when compared to VM's

  • VM's often keep unused memory a while before returning to the OS seeming to 'use' more memory.

  • Some VM's make objects of value types like int/ulong.. adding object memory overhead

  • Some VM's auto-Align data structures a lot wasting memory (for performance gains)

  • Some VM's implement a boolean as int (4 bytes), showing little focus on memoryconservation.