Skip to content
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

Added a shortcut for faster _iter* calls supplied by modules. #7225

Closed
wants to merge 1 commit into from
Closed

Added a shortcut for faster _iter* calls supplied by modules. #7225

wants to merge 1 commit into from

Conversation

SleepProgger
Copy link

Referenced in Issue #7218

This commit adds the possibility to implement faster iterators over Objects in C++.
This will be handy for custom data structures (hint* linked list #7194) and modules providing anything iterable (AI, Simulation related stuff, ...) .

@SleepProgger
Copy link
Author

Little Benchmark (release mode):
C++ impl iterator: Needed 67 ms for 1000000. 0.000067 ms per item.
C++ impl bound functions: Needed 855 ms for 1000000. 0.000855 ms per item.
GDscript iterator: Needed 1100 ms for 1000000. 0.001100 ms per item.
Array: Needed 61 ms for 1000000. 0.000061 ms per item.

Test module and gdscript

@bojidar-bg
Copy link
Contributor

Looks good to me, but assigning reduz to review it (as it touches some really core stuff 😄 )

@reduz
Copy link
Member

reduz commented Jan 14, 2017

Sorry, it's way too hackish, the decision for GDScript is that simple code is prefered over performance, you can most likely find another way around the problem you are trying to solve

@reduz reduz closed this Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants