Author Topic: Patch to speed workspace loading/closing  (Read 6377 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2875
Patch to speed workspace loading/closing
« on: April 23, 2012, 06:04:26 pm »
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.

Code
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
« Last Edit: April 23, 2012, 06:08:59 pm by Pecan »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Patch to speed workspace loading/closing
« Reply #1 on: April 23, 2012, 06:07:23 pm »
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!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2875
Re: Patch to speed workspace loading/closing
« Reply #2 on: April 23, 2012, 06:12:08 pm »
Sorry, but I cannot commit to CB. I don't have the credentials.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Patch to speed workspace loading/closing
« Reply #3 on: April 23, 2012, 07:15:15 pm »
OK, I'll commit it...
(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!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Patch to speed workspace loading/closing
« Reply #4 on: April 23, 2012, 08:03:16 pm »
In svn.
(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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Patch to speed workspace loading/closing
« Reply #5 on: April 24, 2012, 07:59:20 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ