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

Speed up controllers #682

Merged
merged 6 commits into from
Mar 25, 2024
Merged

Speed up controllers #682

merged 6 commits into from
Mar 25, 2024

Conversation

macumber
Copy link
Collaborator

@macumber macumber commented Feb 26, 2024

Fixes #681 by moving optimizations in certain controllers to all controllers

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 12, 2024

@macumber could you add a quick walkthrough of your code via review + some quick text explaining why removing the mutex is the right choice please?

@@ -105,7 +103,6 @@ class OSItemList : public OSItemSelector
bool m_itemsDraggable;
bool m_itemsRemoveable;
OSItemType m_type;
bool m_dirty;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

m_dirty wasn't actually controlling anything here, all that refresh was doing was to clear m_dirty

delete m_reportItemsMutex;
}

void ConstructionObjectVectorController::reportItemsLater() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only a few OSVectorController derived classes were specialized to have the reportItemsLater slot which schedules a call to OSVectorController::reportItems. This PR pulls that functionality into the OSVectorController. Now reportItems will schedule a call to a reportItemsImpl method that will run once so we don't report (and redraw) the same objects multipe times per execute loop.

@@ -60,15 +62,20 @@ class ModelObjectListController : public OSVectorController
private:
openstudio::IddObjectType m_iddObjectType;
model::Model m_model;
bool m_showLocalBCL;
bool m_isLibrary;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

m_showLocalBCL meant to show LocalBCL objects, basically just meant that this was a library controller, I thought m_isLibrary was more clear.

Copy link
Collaborator

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

Not sure I follow everything but I trust your judgment.

@jmarrec jmarrec merged commit 40b6069 into develop Mar 25, 2024
8 checks passed
@jmarrec jmarrec deleted the speed_up_controllers_681 branch March 25, 2024 08:25
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dragging construction set from library is very slow
2 participants