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

> R* and kd-trees are preposterously slow on the JVM compared to the old libANN C++ library, or naive kd-tree implementations. Factors of 100k to 1E6. I may be wrong, but I’m guessing trees confuse the bejeepers out of the JVM

Is somebody here knowledgeable enough to comment further on this? May this be due to excessive allocations and indirections? (It was also one of Bjarne's objections against Java.. composition of classes is always by reference.)



My R* trees in java run within 5x the speed of C++ versions, maybe 3x. I just use object pools and primitive data elements without "accessor" functions.

If you write Java as if the garbage collector and malloc actually worked as advertised, you deserve to have your software run dog slow. Nobody has ever invented a garbage collector or memory defragmentor that works for the usual CRUD Java workloads and for data-heavy or scientific computing tasks.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: