Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Multiple large programs written in LuaJIT that have better performance than the same programs written in optimized C.

The vast majority of benchmarks I've seen are down to LuaJIT performing specific optimizations out of the box that the C compiler used in the comparison can perform but doesn't.

In particular the last time I looked at LuaJIT vs C++ benchmarks, the C++ compiler flags weren't set allow the use of SIMD instructions by default, but LuaJIT does.

There was another recent example I saw where LuaJIT was calling C functions faster than C in a benchmark. Then someone pointed out what the LuaJIT interpreter was actually doing, and how to implement the same speed up in C.

Java people made the same arguments years ago: "Java is just as fast or faster than C++". You'll notice that after 20 years of comparisons, no one who writes high performance code for a living makes that claim.



Java is just as fast or faster than C++ most of the time. No one who writes high performance code for a living makes that claim.

It's true though. https://lmax-exchange.github.io/disruptor/files/Disruptor-1....


Java is fast enough that the increased programmer productivity of the GC and other features wins out in many cases. People aren't choosing Java over C++ because it results in generally more performant code.

How many AAA game engines are written in Java?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: