> Java
Well, there's your first problem, when it comes to performance. Let's not kid ourselves - JVM is great, but it doesn't hold a candle to optimized native code.
I don’t think this is fair? Java isn’t that slow, so long as your task isn’t long running (give JIT time to get going) and isn’t doing anything insane like reflection.
I don’t doubt that the C++ code base may end up faster, but probably because tangential optimisations (like the author’s lock free programming, or more intelligent memory allocations) rather than because the same code runs significantly faster.
It works great for Amazon and Netflix, some people can, others don't.
(Author). So I've gotten pretty far in the index translation, at least as far as the postings lists go. Out of the box for a direct translation there really hasn't been much performance improvement going from Java to C++ in benchmarks.
The Java code was already stupidly optimized and basically allocation free in the hot paths apart from stuff that stays in TLAB or gets trivially elided. And while Java in general is unwieldy as hell for systems programming, it's often surprisingly competitive since the C2 JIT basically gives your system free PGO everywhere on real world data.
The performance impact I've seen has mostly been the design improvements I've found along the way . Paring the index down to now ~2000 lines of C++ has let me find several design refinements that improve buffer pool performance by using more lock free algorithms, improving the index layout to reduce unnecessary block fetches and allowing more accurate prefetching, etc.