Skip to content

Conversation

beicause
Copy link

The current documentation doesn't highlight the advantages of LocalVector and may lead to misunderstandings and discourage its use.
In fact I rarely noticed the differences between LocalVector and Vector before, until seeing many PRs in 4.5 replacing Vector with LocalVector. I think we should provide a clearer explanation of LocalVector in the documentation.

@skyace65 skyace65 added enhancement area:contributing Issues and PRs related to the Contributing/Development section of the documentation labels Jul 25, 2025
@smix8
Copy link
Contributor

smix8 commented Jul 27, 2025

The main benefit of LocalVector, apart from no copy-on-write, is that a LocalVector keeps its allocated memory. So when you frequently edit and clear stuff and it is used internally only you want to use a LocalVector to not waste performance on all the frequent memory alloc.

@beicause
Copy link
Author

The main benefit of LocalVector, apart from no copy-on-write, is that a LocalVector keeps its allocated memory. So when you frequently edit and clear stuff and it is used internally only you want to use a LocalVector to not waste performance on all the frequent memory alloc.

Will this be changed? Related: godotengine/godot#105928 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:contributing Issues and PRs related to the Contributing/Development section of the documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants