I assume this can be improved further
I'd assume the same. I don't have your 492M chonker of a registry, so I can't test my theory, but I'd check the last array entry first in find_subkey, and if the given key is greater or equal, return that and skip the binary search. I think the registry is stored in sorted form, so that check will succeed every time during boot. This would give an extra string compare on actual insertions, but that's probably worth it. (I can think of a few other possible optimizations, but I think they'd pessimize the case of normal-sized registries, be annoyingly complex, and/or do nothing if the above is in place, so I'll omit them for now. No point posting walls of unnecessary text.) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10804#note_138644