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

LIS new capacity policy #6

Merged
merged 2 commits into from
May 1, 2020
Merged

LIS new capacity policy #6

merged 2 commits into from
May 1, 2020

Conversation

shaomeng
Copy link
Contributor

@shaomeng shaomeng commented May 1, 2020

Adjust the size policy of LIS lists (implemented using std::vector<>): the new policy is that it will have at least half empty reserved capacity after a clean operation.

It aims to avoid a scenario where a list grows to size X, cleaned to size X/2, and then re-grows to X, while requesting a memory allocation.

It will result in slightly less efficient memory utilization. But in one test, both clang and gcc report a ~4% performance improvement.

@shaomeng shaomeng merged commit 491fc4f into master May 1, 2020
@shaomeng shaomeng deleted the LIS_new_policy branch May 1, 2020 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant