On Sat May 2 13:29:01 2026 +0000, Alfred Agrell wrote:
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.) Your suggestion brings down the time to 3.5s.
However, I corrupted my registry in the first attempt of the change so it is not necessarily 100% the same as before (so master branch still times at 16.8s) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10804#note_138646