Author Topic: Bug Report: [#18755] C::B hangs for 20 seconds while opening large project...  (Read 39730 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
I found this bug this week. At first I thought it had to do with directory traversal (old bug), but it seems it's not the case.

https://developer.berlios.de/bugs/?func=detailbug&bug_id=18755&group_id=5358

Quote
Original Submission:
I have a PHP project under a WAMP directory (with a symlink on c:\htdocs for easy access) under Windows 7 32 bit.

Build info:

Build: Oct 13, 2012 18:50:41 - wx 2.8.12 (Windows, unicode) - 32 bit
"Version: svn build rev 8455
SDK Version: 1.13.11"

I noticed that when I open this particular project, Code::Blocks takes 22 seconds to open the project. Even when I add a file, it's painfully slow.

While this project is loaded, loading even trivial projects (like a hello world located elsewhere) takes 17 seconds.

It happened with the 8248 nightly, but also with the October 7 nightly 8438 and with 8455 (latest available at the time of this report). I can't replicate the bug at work, so it might be a rare case. I'll attach some files to add more info.

It's a long PHP project, with 2121 files including several javascript toolkits in it (ExtJS, jQuery, etc). Notice that I set up a different directory for the "executable" under build options to not disturb the source tree (maybe that's it, but I can't be sure, I'm attaching the cbp file just in case).

The last thing I saw was
"Project data set for C:\htdocs\SIG\SGPG\js\app\common\commonfuncs.js
Top Editor: C:\htdocs\SIG\SGPG\js\app\common\commonfuncs.js "

After this, I get the 20 sec hang, and finally, the environment variables are loaded.
A way to solve this would be to add more debug messages on each stage of project loading (or whatever post-loading stuff is done).

After loaded, adding a file takes 7 seconds (I'm in the middle of refactoring an urgent project, this is a royal pain in the arse guys and my job might be at stake :( Please help! )

I can share the full project to individual developers on request, if needed.

(EDIT: Unattached project file for confidentiality)
« Last Edit: October 18, 2012, 05:55:23 am by rickg22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
I can't attach the full project in public, it's confidential stuff (doh) and over 64 megs...

the easiest thing would be to add debugging breadcrumbs to print messages on the debug window to see where the hang happens... (I might need to be given a patched build for this so I can test)

Well, I'm off to work. Keep me updated.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Attaching my default.conf file... (this one's at home)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
...In wonder if you can pin-point the hang to a particular file. What happens, if you remove all but the ones mentioned in the log?

- Also, are there any non *.js files? What, if you remove files of certain type(s) step-by-step?
- Also, does it change if you remove the *.layout file?
- Also, is it generally related to the number of files? I.e. if you remove "half" of the files, is it loaded twice as fast?

BTW: I just opened the project file - works fine and fast here... I'm afraid this is of no help.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12195
    • Travis build status
Why don't you build a debug build of C::B and use the debugger to break it when it is hanged?
I'm sure you'll pinpoint the slow function/code.
(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 Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
As to the timing, isn't it rather expectable that loading a 64 MB project will take some time? Smaller projects seem to load enough quick. My "big projects" are about 1.5 MB of source code and about 300 source files (thus, not so big :) ) and I cannot complain.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
If you move everything out of the WAMP directory, does the problem go away?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
As to the timing, isn't it rather expectable that loading a 64 MB project will take some time? Smaller projects seem to load enough quick. My "big projects" are about 1.5 MB of source code and about 300 source files (thus, not so big :) ) and I cannot complain.

Well, most of the megabytes are in .gif, .jpg and .pdf files. The real issue is that I have no problems opening this project at work (or with previous versions of C::B).

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Wait... maybe "debugging" isn't the right word. What we need is a profiler. After profiling, I'm sure I can pinpoint the cause of the slowdown. :D How can I profile C::B?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Did you compare the default.conf's from at work and the system with the lag ?
Do you have any network shares, that might be involved ?
Did you try it with the exact same copy of C::B at both systems (packed here and unpacked there in a clean folder) ?
Are the related paths the same ?
Are there any probaly related (outdated) libs in the search path ?

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
btw, it takes about 8s to open the C::B cbp on a pretty beefy Win 7, 64 bit system with no open editors. (CC on/off makes no difference.) Is that normal?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Did you compare the default.conf's from at work and the system with the lag ?

Not yet, I'm still at work.

Quote
Do you have any network shares, that might be involved ?

Not that I know of.

Quote
Did you try it with the exact same copy of C::B at both systems (packed here and unpacked there in a clean folder) ?

The one at work seems to have another wxWidgets.dll, and I think I copied it to the system folder (at work). The C::B folder was zipped and unzipped pristine from c:\cb at work, to c:\cb at home. I had to download the wxWidgets dll separately (at home I used the one you provided), so that might be a candidate.

Quote
Are the related paths the same ?
At home I'm using a WAMP, at work I'm using a XAMPP. Both have a long url before the www, and both are shortcutted with a symlink (using Window's mklink command) to c:\htdocs. Note that there's no difference between opening the original path and the symlinked one, both take the same to open.
[/quote]

Quote
Are there any probaly related (outdated) libs in the search path ?

Okay, I did not check that one. Are you saying home's C::B is using another lib? Is there a way to find out which libraries (dlls I suppose) C::B is using at runtime? (Is there a plugin for that, for example?)
« Last Edit: October 16, 2012, 11:43:03 pm by rickg22 »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Quote
Are there any probaly related (outdated) libs in the search path ?

Okay, I did not check that one. Are you saying home's C::B is using another lib? Is there a way to find out which libraries (dlls I suppose) C::B is using at runtime? (Is there a plugin for that, for example?)

You can run C::B through dependency walker: http://www.dependencywalker.com/ .

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
OK, before anything, thank you so much for your support guys. Your suggestions and interest are really a relief.

So, I'm compiling wxWidgets right now to compile C::B from source. I'll keep you posted.

BTW, opening the C::B project itself only took around 5 seconds delay.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
OK, before anything, thank you so much for your support guys. Your suggestions and interest are really a relief.

So, I'm compiling wxWidgets right now to compile C::B from source. I'll keep you posted.

BTW, opening the C::B project itself only took around 5 seconds delay.

I did a little profiling of the time it takes to load the C::B project on my Win7 PC. It looked like most of the time was taken on the rebuilding the project manager tree view. Loading the project file and creating the project instance was very fast. Loading the C::B unix project (including building the tree view) takes less than a second on my lesser spec'd Ubuntu machine at home (actually it looks almost instantaneous after the first time).

EDIT: This could be relevant http://forums.wxwidgets.org/viewtopic.php?f=1&t=35118 but we only open a few nodes at most... Maybe this too http://forums.wxwidgets.org/viewtopic.php?t=16124&p=71104
« Last Edit: October 17, 2012, 05:10:45 am by dmoore »