4 ms·
> JVM has always been on par if not often faster than hand-written C code. I have never found this to be true. There are a few programs (Talend, MySQL worksho
by Shorel 3y ago
> JVM has always been on par if not often faster than hand-written C code.
I have never found this to be true.
There are a few programs (Talend, MySQL workshop) written in Java that I sometimes have to use, and I avoid them as much as I can, because they are slow, bloated, and eat lots of memory.
Java new operator is faster than malloc, because Java allocates all memory needed from the OS before starting the program. And malloc is extremely slow. C++ new operator uses malloc so it is also slow.
Stack allocation in a C program is hundreds of times faster than using new in Java.
And that's for one feature, there are many other features like C++ compile-time calculations in templates that simply have no Java equivalent.