Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use SdfPathSet instead of StdPathVector for instancePaths in UsdImagingInstanceAdapter::_Populate #1823

Merged

Conversation

mtavenrath
Copy link
Contributor

Description of Change(s)

When having a high count of instances the runtime of std::vector::insert at 'random' positions in this function can potentially go up to O(N^2) whereas std::set::insert runs with O(N log(N)). I have profilings of scenes with 1M instances where std::vector::insert takes ~100s of total time (25% load time) whereas times for std::set::insert are mostly noise in the profiling.

Also when erasing an prototype avoid a copy by using std::swap to grab the data from the instancerData structure.

Fixes Issue(s)

  • [X ] I have submitted a signed Contributor License Agreement

…er count of instances the runtime of std::vector::insert at 'random' positions can potentially go up to O(N^2) whereas std::set::insert runs with O(N log(N)). I have profilings of scenes with 1M instances where std::vector::insert takes ~100s of total time (25% load time) whereas times for std::set::insert are neglectable.

Also when erasing an prototype avoid a copy by using std::swap to grab the data from the instancerData structure.
@jilliene
Copy link

jilliene commented Apr 4, 2022

Filed as internal issue #USD-7305

@pixar-oss pixar-oss merged commit 4c3c409 into PixarAnimationStudios:dev Sep 1, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants