lring: initial

WIP, needs to be benchmarked and tested. /cc @piscisaureus @bnoordhuis