derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
679 stars 33 forks source link

State chart debugger history tab causing stuttering #84

Closed MidZik closed 4 months ago

MidZik commented 4 months ago

I think the addition of icons to the state chart debugger history tab in 0.13.1 is causing some stuttering. Whenever lines are added to the history tab there is a noticeable stutter. Ignoring everything (events, transitions, state changes) makes the stutter go away. See the platformer example, I notice the stuttering there.

Reverting to 0.13.0 makes the stuttering go away.

Edit: It's the state_chart_debugger.gd _on_timer_timeout function that is causing problems. Profiler says it takes 50ms to run. Specifically, setting _history_edit.text takes a while. Looks to be an issue with Godot itself.

derkork commented 4 months ago

Funny enough I noticed this problam this morning myself. It's not in the range of 50ms but its still bad. How did you track it down the setting of the text property? This doesn't seem to show in my profiler output, is there some special setting or did you add some code to measure it? I'll prepare a fix in any case...

derkork commented 4 months ago

I opened up an issue with the engine: https://github.com/godotengine/godot/issues/88809 . For now I'll use some plain text representation which seems to work fine.

MidZik commented 4 months ago

Commenting out that line removes the stutter, and get_history_text is very quick.

derkork commented 4 months ago

Ok, just wanted to make sure I didn't miss out on some neat profiler feature. Thanks!