-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Array.pop_front is 100 times slower than Array.pop_back #45455
Comments
I'd say that's expected, if you I suggest adding documentation to |
You're probably looking at linked list implementation, see related proposal at godotengine/godot-proposals#1522. But it's also possible to use |
I'm sorting array before working with it, so I already changed ascending order to descending to have max performance. |
Godot version:
3.2.3 stable, 3.2.4 beta 6
OS/device including version:
Windows 10
Issue description:
Array.pop_front
method is way slower thanArray.pop_back
method (based on array size).For array with 1000 elements
pop_front
takes 4 ms whilepop_back
takes 0 ms.For array with 10000 elements
pop_front
takes 420 ms whilepop_back
takes 2 ms.For array with 100000 elements
pop_front
takes 38000 ms whilepop_back
takes 11 ms.Steps to reproduce:
Minimal reproduction project:
pop_back_speed.zip
The text was updated successfully, but these errors were encountered: