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

Use 1.5 growth factor for CowData #101138

Closed

Conversation

Nazarwadim
Copy link
Contributor

Same as #100944 but for CowData.
Similarly, if we call resize greater than 1.5 * capacity, then as much memory as we request is allocated, not a power of two.

I tested the memory usage in tps-demo and it decreased by several tens of megabytes.

@Nazarwadim Nazarwadim requested a review from a team as a code owner January 4, 2025 20:55
@hpvb
Copy link
Member

hpvb commented Jan 4, 2025

This is not a bad idea, but using floating point math here is not required, and the move from/to xmm regs might be detrimental to performance, especially when inlined.

https://godbolt.org/z/Phc53zGq1

Edit: This also alleviates the need for the ceil call.

@Nazarwadim
Copy link
Contributor Author

@hpvb See https://godbolt.org/z/Kjjaaeob8.

Also, I don't think we need to bother with optimization, since this event is unlikely and we will spend more time on branching and memory allocation.

@Chaosus Chaosus added this to the 4.x milestone Jan 5, 2025
@Nazarwadim
Copy link
Contributor Author

Ohhh no, poor dependencies. There is probably a size dependency in c# and gdextension.

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