On Tue Feb 13 16:21:22 2024 +0000, Gabriel Ivăncescu wrote:
I used your patch and added traces to `init_cpu_info` in ntdll and in `X11DRV_MapNotify`, then subtracted them. My results are: Upstream: 1070 With return FALSE hack: 615 Again, with an app sitting in the background before launching Notepad++, so prefix initialization is avoided (I mean, it's not a contrived case, I actually do launch notepad++ from other apps, which is why it's annoying me).
Here's some more information and measurements. You guess correctly first time that it's *mostly* the display cache update that is causing it, though it's still weird for me.
The main culprit are the two calls in `update_display_cache`. BUT, the weird thing is that, despite the first one being unconditionally called, it's actually the second one that has a much worse impact.
``` Hacking only the first is_virtual_desktop() to FALSE: 988 Hacking only the second is_virtual_desktop() to FALSE: 783 (?!?) Hacking both of them to FALSE: 735 Hacking *ALL* is_virtual_desktop to FALSE: 615 ```
It makes little sense to me why the second is_virtual_desktop (the one on the `if (ret && is_virtual_desktop())` line) has so much more impact.
But it also shows that it's these 2 calls that together make up the bulk of the perf impact.
Any ideas?