The databases I implemented experimented with various ways to compile queries. Turns out that the JVM can run quite fast. I feel like LLVM (Julia) is likely to be able to be better for throughput and definitely better for predictability of performance.
If you know layouts and sizes, then your generated code can run really fast - using SIMD and not checking bounds is a win.
Hugepages would greatly reduce pagetable bookkeeping, but obviously may magnify writes. Wish I could have tried that!