Redesign picking to avoid using OpenGL. Previously picking involved several GL operations per mouse movement, but now the GPU/GL isn't used at all.
By avoiding OpenGL and the graphics driver we also reduce CPU usage. Despite reimplementing the logic on the CPU, it still takes less CPU time than going through GL did.
This new approach also dramatically reduces the number of picking paint cycles required for cursor movement since the pickability of the entire screen is calculated and cached. The cache is only invalidated when the screen contents change so for typical desktop usage where the screen is mostly idle, cursor movement doesn't incur anywhere near as many paint cycles as it used to.
Even regular repaints are now noticeably faster because the GL pipeline
isn't getting stalled by a call to
CPU usage on an Intel i7-7700, tested with two different GPUs/drivers:
|Moving the mouse:|
|Moving a window:|