Hacker News new | past | comments | ask | show | jobs | submit login

Theoretically, the CLR-VM should be able to reach better performance than the JVM, since it has value-types. Within the JVM an array of some objects is really an array of references, which is bad for your hardware caches and requires an additional pointer dereference. The question is how significant that is for non-numerical applications.



Theoretically, your sufficiently advanced compiler and/or JVM will figure out where they can replace objects by value types. So, theoretically, that does not matter.

The difference should be visible in practice, though. AFAIK, it is not really visible, though. That probably is because the JVM has been tuned longer.


In practice, value types are a huge performance differentiator.

That is why even the simplest benchmarks involving value types tend to beat Java's optimized code gen.


Isn't Scala 2.10 introducing value types that are beneficial for situations like this? I don't know about any potential limitations though.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: