Hacker News new | ask | show | jobs
by codedivine 5074 days ago
Well, two points:

1. Using raw pointers as opposed to vectors gives 2x the performance on my machine.

2. This is a microbenchmark with extremely simple array indexing pattern. JVMs can optimize away the array bounds checks penalty in this case but those become hard to do once your access patterns become anything other than "i" or "i-1". For example, even more general linear subscripts are hard to correctly optimize for array bounds checks, let alone anything non-linear. How do I know? Compiler researcher here :)

However, still impressive to see JVMs advance.