Closed sudara closed 1 year ago
Looks like the preview snapshot is also being called twice per ComponentModel::updateModel
Color picker is doing a good job being efficient
restoreBoundsIfNeeded
sorta takes up a gross 15ms when the inspector closes.
The preview snapshot and doubling up on selection/tree closing is fixed in #80.
restoreBoundsIfNeeded
is a tricky one. As expected, resized being called multiple times is hurtful.
Post optimization Debug times:
initial tree construction of > 8k items and inspector construction in 37ms:
select component in 1.6ms:
Outline component in 3ms
toggle back on in 25ms:
toggle off in 21ms:
lowest hanging fruit left is probably restoring bounds
Almost all time is spent in setResizable
— it seems to call recreateDesktopWindow
.
Without calling setResizable
, toggle off is down to 1.5ms
And toggle on is down to 1.2ms
There's not much change in behavior since setResizeLimits
is still being called, so that prevents unintentional UI states (like resizing the inspector when disabled).
Note: All these timings are Debug (important context for the inspector) and just performed on my main app, which does have a lot of components ~but not outrageous~.
Outline Component
8735 calls to close subitems, adding up to 137ms.
Select Component
Again, recursively closing is an offender, and it's called twice.
Toggle
Looks like
ComponentModel::selectComponent
is called twice,