Since this is the bottleneck, and both files have relatively small codebases may be worth trialing a port. Low priority obviously. To keep scope under control, this would be a strict port, no re-organization of underlying database to LMDB.