gloot icon indicating copy to clipboard operation
gloot copied to clipboard

Perf: highlight slot style on ctrl_item_slot_ex

Open kyle-wannacott opened this issue 1 year ago • 3 comments

This is running whilst moving the mouse around (InputEventMouseMotion) not even doing anything with the actual slot.

The best part is, I don't have a slot_highlighted_style set on any of my ItemSlots.

I wonder if there is a better way to do this?; like using the signal for mouse_entered/focus_entered, mouse_exited/focues_exited?

Cheers.

Line 51 in ctrl_item_slot_ex.gd: image

kyle-wannacott avatar Apr 23 '24 22:04 kyle-wannacott

I only see this when mouse moves shows up breifly then disapeers from profiler, not really a huge hit on time honestly as its barely a 2/10ths a ms for me. image

TreaBeardGaming avatar Apr 24 '24 12:04 TreaBeardGaming

I wonder if there is a better way to do this?; like using the signal for mouse_entered/focus_entered, mouse_exited/focues_exited?

Does this cause any performance issues for you? But regardless, I agree, updating the control every time the mouse is moved is a bit too aggressive. There's definitely a better way.

peter-kish avatar Apr 25 '24 17:04 peter-kish

Does this cause any performance issues for you?

Not really, but I have a half decent CPU (5900x); typically you don't make games targeted at your own hardware.

To give you context on this. Its a difference of around 250fps; so I get 400fps while moving the mouse around and 650fps while its not moving.

kyle-wannacott avatar Apr 25 '24 17:04 kyle-wannacott

Should be fixed in v2.4.9.

peter-kish avatar Jun 01 '24 16:06 peter-kish