News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Patch to speed workspace loading/closing

Started by Pecan, April 23, 2012, 06:04:26 PM

Previous topic - Next topic

Pecan

The following patch speeds loading and closing a workspace to about half (at least on my system).

FindTargetsDebugger() is rebuilding the debugger menu system for every activation of a project. It does not need to do this during opening and closing of a workspace since after the workspace is loaded, CB will activated the correct project anyway.

It does not need to do it at all during closing of a workspace. With the patch, closing the CB workspace changed from 7 to less than 1 second.

Index: src/sdk/debuggermanager.cpp
===================================================================
--- src/sdk/debuggermanager.cpp (revision 7937)
+++ src/sdk/debuggermanager.cpp (working copy)
@@ -1146,7 +1146,10 @@
}

void DebuggerManager::FindTargetsDebugger()
-{
+{
+    if (Manager::Get()->GetProjectManager()->IsLoadingOrClosing())
+        return;
+
    m_activeDebugger = nullptr;
    m_menuHandler->SetActiveDebugger(nullptr);



svn build  rev 7937 (2012-04-23 04:29:22)   gcc 4.6.1 Windows/unicode - 32 bit

oBFusCATed

Go on and commit it, we can always revert it, if it breaks something, but I doubt it will.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Pecan

Sorry, but I cannot commit to CB. I don't have the credentials.


oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: Pecan on April 23, 2012, 06:12:08 PM
Sorry, but I cannot commit to CB. I don't have the credentials.
Why not? You should ask Yiannis to adjust that. I guess its an error...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]