-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large number of CanvasItems in the scene slow down input #56199
Comments
Win10 4th gen intel i7, so slightly better than @TrickMe. Just did a simple test where I spawned 10k sprites & 10k buttons. No input lag. For fun I made it spawn 50k of each. The mouse was fine, but there was a slight delay in the "pressed" signals from the buttons. |
@HubbleCommand |
I will look at the project later if I have time. There are 2 solutions if you have that many sprites that are affecting performance: If not all sprites are on the screen, and you have large / high detail sprites, you can convert them to 2D meshes. While multimesh2D uses 2D meshes, you use them in opposite scenarios:
|
I can confirm the issue, tested on Linux with an Intel i5 11500, here some results: |
I'd look into using a C++ profiler to determine where the bottleneck is. That said, asking the engine to perform 15,000+ input events every time the mouse cursor is moved is asking a lot. It'd probably be better to throttle the frequency at which InputEventMouseMotions are sent if the input system is overloaded. |
For the PanelContainer test I've added the nodes as a child of a VBoxContainer so only a couple of them are visible on screen (18 out of 15.000 are visible). |
I've also tried to use MOUSE_FILTER_IGNORE but it doesn't solve the issue. |
I've done the same test with a low spec pc (Intel Celeron J3355): |
Godot version
3.4.2 stable official
System information
Linux Mint 20.2 Cinnamon, Kernel 5.11, GLES3, AMD Athlon II X4, AMD Radeon Rx 570X, Mesa 21.3
Issue description
Mouse movement cripples performance massively if many (~10.000) CanvasItems (Control or Node2D) are in the scene.
It's specially bad if
Input.set_use_accumulated_input()
isfalse
, but is also noticeable iftrue
.Steps to reproduce
Place many CanvasItems in the scene, about 10.000 and move the mouse around.
Minimal reproduction project
rep_manyLines.zip
The text was updated successfully, but these errors were encountered: