Java: the phonograph of 64-bit computing
Begin pontification!
There are a few golden rules in high performance server development:
- use the right algorithm / data structure for the job
- precompute as much as you can
- avoid system calls
Usually this boils down to an offline (or high latency) system that sends data to a fast serving tier via message replication or file push.
And basically the only way to read data from a file without syscalls is with mmap.
Too bad Java’s mmap implementation was so half-assed. In Java 1.5 (and possibly 1.6, I’m not sure), you…
- can’t map files larger than 2 GB (yay signed integers!)
- can’t do a bulk copy from an absolute position
- can’t even unmap an mapped file!
The rationale for the non-resolution or won’t-fix status of these bugs is pretty sad/hilarious, or as I prefer, “sadlarious”.
It’s basically “we designed NIO in 1973″ and “obscure security issue means we’ll reclaim that memory when we feel like it”.