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

PluginList::refresh speedup #2046

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

Liderate
Copy link
Contributor

This change should decrease the time it takes to refresh the plugin list, particularly for Fallout 4 and Starfield instances where the loadOrderMechanism call is costly.

I tested by enabling/disabling an empty mod in a Fallout 4 instance containing about 2000 dummy ESMs and ESPs. The loadOrderMechanism change saw the average time decrease from 2900ms to 710ms. The other changes further reduced that to 210ms.

src/pluginlist.cpp Outdated Show resolved Hide resolved
src/pluginlist.cpp Outdated Show resolved Hide resolved
@Holt59 Holt59 merged commit fff03d3 into ModOrganizer2:master Jun 10, 2024
2 checks passed
if (current.get() == nullptr) {
continue;
}
QString filename = ToQString(current->getName());
const QString& filename = ToQString(current->getName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not important, but for future reference, the change to this line does nothing. ToQString returns a QString, not a const QString&, so a QString has to be constructed in this stack frame anyway. There's no copy happening in the old or new version due to copy elision.

# 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.

3 participants