The way the data is currently stored there is only ever one key... the security identifier. mmap would probably make sense, though that is only C, yes? Or is there a way to do it in perl....
If only C, then I would probably leave it as an option to look at if all Perl fails.