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

scoped_***_reference constructor/destructor triggered multiple times #69

Open
skarndev opened this issue Nov 13, 2020 · 1 comment
Open

Comments

@skarndev
Copy link
Contributor

scoped_***_reference after creating are being passed between various functions using std::move semantics. That triggers destruction and subsequent construction on each move. That results into many repeating search operations on noggit::async_multimap_with_normalized_key by calling emplace() and erase() methods. This leads to a significant slowdown in loading performance. World::add_model_instance() is the example of this happening, but happens multiple times throughout the code for textures, models and WMOs.

@bloerwald
Copy link
Contributor

It seems that the issue is that it is not using move semantics? When moving a scoped reference, the moved from is set to be !_valid, and the dtor doesn't call erase (and the ctor doesn't call emplace) in that case.

It appears that there is something wrong with move vs copy somewhere but on a quick look I was unable to find it. ModelInstance also appears to be fine, so I'm slightly at a loss here. Probably needs some backtrace logging to find out where exactly those calls are happening and with what arguments, …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants