peter-kish / gloot

A universal inventory system for the Godot game engine.
MIT License
625 stars 28 forks source link

Perf: highlight slot style on ctrl_item_slot_ex #199

Closed LeeWannacott closed 4 months ago

LeeWannacott commented 6 months ago

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

TreaBeardGaming commented 6 months ago

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

peter-kish commented 6 months ago

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.

LeeWannacott commented 6 months ago

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.

peter-kish commented 4 months ago

Should be fixed in v2.4.9.