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 std::vector inside lcArray class #849

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ScanMountGoat
Copy link

This replaces the custom dynamic allocation logic for lcArray with std::vector. The standard library vector grows by some factor when resizing to make the insertion cost average out to be roughly constant. The old implementation for lcArray appeared to be resizing every N elements for some user configurable N. When loading a large model with roughly 58000 pieces, Project::load takes about 3000ms on my machine for the old lcArray and 2800ms for the new implementation with std::vector when profiling in Visual Studio. Application memory usage in task manager seems to be identical for both versions. Removing lcArray entirely is more involved, so I preserved most of the existing API.

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.

None yet

1 participant