User forums > Using Code::Blocks
changes between r7459 and r7460 slow down project load
cbnewbie:
After an svn upgrade from version r7450 to r7520 some time ago I discovered that loading my projects takes much more time now. Usually I was impressed that my projects could be loaded within 2 seconds. But now loading the same project takes at least 30 seconds! Depending on the size of the projects I may have to wait several minutes...
After installing several svn versions I found out that for versions until r7459 the time for loading project files is amazingly fast, but from version r4760 on there is a huge delay in loading them. What did change in codeblocks and how can I disable this feature?
ollydbg:
--- Quote from: cbnewbie on October 28, 2011, 09:12:28 am ---After installing several svn versions I found out that for versions until r7459 the time for loading project files is amazingly fast, but from version r4760 on there is a huge delay in loading them. What did change in codeblocks and how can I disable this feature?
--- End quote ---
Did you mean: r7460?
But I can't find any reason why r7460 will be slow than 7459.
What's changed in r7460 looks like:
--- Code: ---Index: trunk/src/sdk/cbproject.cpp
===================================================================
--- trunk/src/sdk/cbproject.cpp (revision 7459)
+++ trunk/src/sdk/cbproject.cpp (revision 7460)
@@ -72,7 +72,7 @@
virtual wxDirTraverseResult OnDir(const wxString& dirname)
{
- return wxDIR_IGNORE;
+ return wxDIR_CONTINUE;
}
bool IsValidPath() { return m_IsValidPath; }
@@ -380,7 +380,7 @@
if (dir.IsOpened())
{
ProjectDirTraverser traverser;
- dir.Traverse(traverser, wxEmptyString, wxDIR_FILES);
+ dir.Traverse(traverser, wxEmptyString, wxDIR_DIRS | wxDIR_FILES);
if (traverser.IsValidPath())
base = tmpbaseF;
}
--- End code ---
cbnewbie:
Thanks a lot! I simply changed those lines in r7520 back. Now loading my projects is quick as before (<2 sec). I have no idea why cb behaves like this but I'm glad I know how to overcome this problem in future svn releases.
oBFusCATed:
I can confirm that loading large projects is very slow.
Jenna:
--- Quote from: oBFusCATed on October 28, 2011, 10:41:30 am ---I can confirm that loading large projects is very slow.
--- End quote ---
Not here, but it might depend onthe place where your project file is located.
The ProjectDirTraverser is only called from inside CalculateTopLevelPath, and that should not happen so often.
Can you apply the following patch and start C::B with "-d" parameter, and have alook ath the "Code::Blocks Debug".
You should see how often the traverser is called and how long it needed.
You can also try what happens if the CodeCompletion-plugin is disabled.
--- Code: ---diff --git a/src/sdk/cbproject.cpp b/src/sdk/cbproject.cpp
index c50a046..ec7d528 100644
--- a/src/sdk/cbproject.cpp
+++ b/src/sdk/cbproject.cpp
@@ -348,6 +348,7 @@ void cbProject::CalculateCommonTopLevelPath()
wxFileName base = GetBasePath() + sep;
Manager::Get()->GetLogManager()->DebugLog(_T("Project's base path: ") + base.GetFullPath());
+ int traverser_count = 0;
// this loop takes ~30ms for 1000 project files
// it's as fast as it can get, considered that it used to take ~1200ms ;)
// don't even bother making it faster - you can't :)
@@ -381,10 +382,13 @@ void cbProject::CalculateCommonTopLevelPath()
wxDir dir(tmpbaseF.GetPath());
if (dir.IsOpened())
{
+ Manager::Get()->GetLogManager()->DebugLogError(F(_("We call ProjectDirTraverser %d times"), ++traverser_count));
+ wxStopWatch sw;
ProjectDirTraverser traverser;
dir.Traverse(traverser, wxEmptyString, wxDIR_DIRS | wxDIR_FILES);
if (traverser.IsValidPath())
base = tmpbaseF;
+ Manager::Get()->GetLogManager()->DebugLogError(F(_("traversing took %d ms"), (int)sw.Time()));
}
}
}
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version