SublimeDebugger icon indicating copy to clipboard operation
SublimeDebugger copied to clipboard

OutputPanelBar is too slow to update position when layout changed

Open huanzai opened this issue 1 year ago • 6 comments

Should we change the layout checker frame rate from 4Hz (0.25s) to 30Hz (0.033s) ?

def startup():
	Images.shared = Images()
	global _update_timer
	_update_timer = core.timer(Layout.update_layouts, 0.25, True)  # => core.timer(Layout.update_layouts, 0.033, True)

The performance looks OK, and the experience has been enhanced.

huanzai avatar Nov 27 '24 14:11 huanzai

Did you look at the performance of the plugin_host-38? This isn't free and is always costing cpu cycles for something that almost never changes anyway. How often are you modifying the layout of the editor anyway?

daveleroy avatar Nov 28 '24 02:11 daveleroy

The issue not only when change the layout, but also scoll the console panel.

the performance of the plugin_host-3.3 looks ok.

huanzai avatar Nov 28 '24 03:11 huanzai

Its using an extra 3 percent at all times for me which for me seems pretty unacceptable

daveleroy avatar Nov 28 '24 04:11 daveleroy

https://github.com/daveleroy/SublimeDebugger/blob/6f4c900cf5c27f93d1289abc6731e34030ece78e/modules/ui/layout.py#L272 controls how many updates before the bottom bar returns after scrolling ends

Does changing the value from say -2 to a higher value to maybe even positive like 3 or 4 so it returns half a second after scrolling ends help? Is that what you are trying to improve here?

daveleroy avatar Nov 28 '24 05:11 daveleroy

The effect has improved after change the value to +3. But I still need improve the checker frame rate. In my computer the cpu cost of plugin_host-3.3 is always 0 percent.

huanzai avatar Nov 28 '24 07:11 huanzai

Debugger runs in plugin_host-3.8 not plugin_host-3.3.

If you want to put in your own code to do this go for it but I'm wary of any performance impacts that happen when idle. The real solution is getting sublime to implement events when the layout changes. There is the ticket for that https://github.com/sublimehq/sublime_text/issues/12

daveleroy avatar Nov 28 '24 08:11 daveleroy