TCustomTreeView creates a scaled image resolution for Images and StateImages in the DoPaintNode method. This occurs every time DoPaintNode is called, even when the Node can't be drawn because its not visible in the client area.
Wouldn't it be more performant if it occurs only once in DoPaint? Members could be used to store the image resolutions created in DoPaint, and accessed instead of allocated in DoPaintNode.
Or, at a minimum, create the scaled image lists only when the Node is actually visible in DoPaintNode?
Just an idea...
[EDIT]
Sorry, that riff was in reference to Lazarus trunk.