It turns out the (primary) cause of this was converting color data from the registry from a wide string to a short string every time the dialog refreshed - the function Windows uses to do this (WideCharToMultiByte) is insultingly slow. I just made the palette data deserializer work on wide strings directly, which involved some other code changes, but not too bad.
I also tried to solve the palette dialog flickering wildly when you scroll through the palettes, which is due to invalidating the entire dialog window when the only thing that needs to be repainted is the color buttons. I didn't really like what I had to do to get that to work... but it seems alright?
58
It turns out the (primary) cause of this was converting color data from the registry from a wide string to a short string every time the dialog refreshed - the function Windows uses to do this (
WideCharToMultiByte
) is insultingly slow. I just made the palette data deserializer work on wide strings directly, which involved some other code changes, but not too bad.I also tried to solve the palette dialog flickering wildly when you scroll through the palettes, which is due to invalidating the entire dialog window when the only thing that needs to be repainted is the color buttons. I didn't really like what I had to do to get that to work... but it seems alright?