Author Topic: Opening project very slow with files on network share  (Read 6320 times)

Offline cybertron

  • Single posting newcomer
  • *
  • Posts: 4
Opening project very slow with files on network share
« on: September 23, 2008, 08:48:50 pm »
I'm trying to use Code::Blocks with a project at work which previously didn't have an IDE associated with it.  The setup is a bit strange due to some old equipment that can't be easily swapped out for a number of reasons, all of which have to do with lawyers.:)

Anyway, the problem is that the source is stored on a server and shared via Samba to a Windows PC over a 16/4 token ring network, and when I create a project including the source (around 3000 files), it takes over 5 minutes to open.  I think the network may be a little flaky because when I tried to copy the source to the local hard drive it failed on files that I know are accessible just fine.  I'm assuming that CB is accessing all of the files when it opens the project (if I add a smaller subset of files it's faster) and the crappy network is causing the slowness, so I'm wondering if there is some way to keep it from doing that.  I've disabled all of the plugins already so I don't think it's a problem with them and I've messed with all of the settings I could find that I thought might help, but so far no luck.

Any suggestions?  TIA.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Opening project very slow with files on network share
« Reply #1 on: September 23, 2008, 09:23:08 pm »
Do you really disabled code-completion-plugin, or if not switched the symbols-browser to show only current files symbols ?

Where is your project-file located ?
Is it on the network share ?
How large is it (with 300 files it might have some 100 kb) ?
What happens if you create a project on the local drive and add the files from the share ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Opening project very slow with files on network share
« Reply #2 on: September 24, 2008, 04:55:19 pm »
Code::Blocks must open all files at least twice, for two reasons:
1. code completion, this can be turned off
2. dependency calculation, tihs cannot be turned off

In practice, the file manager should hide the second load, and dependency calculation should only run once, too. The dependency information is cached in the .depends file, and in subsequent project loads, Code::Blocks only has to check the files' last modification dates.
Unluckily, while this is lightning fast on local drives, the performance for checking file attributes sucks big time over Samba, as nothing is cached, and so it costs at least one seek time and 2 RTTs, so at best 30-50 ms for every single file (assuming the file server does nothing else). Surely a few thousand queries are being painful in that light.

However, I don't see a way how this could be sped up. Code::Blocks must maintain a dependency chain to know what must be recompiled at which time. So... there's little it can do other than query every file for its modification data.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline cybertron

  • Single posting newcomer
  • *
  • Posts: 4
Re: Opening project very slow with files on network share
« Reply #3 on: September 24, 2008, 11:52:03 pm »
Okay, thanks guys.  I'm actually not using Code::Blocks to compile this project, so if there's some way to eliminate the dependency calculation that would work for me, but I don't see any way to do that.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Opening project very slow with files on network share
« Reply #4 on: September 25, 2008, 08:37:32 am »
so if there's some way to eliminate the dependency calculation
2. dependency calculation, tihs cannot be turned off
...incompatible. ;-)
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7699
    • My Best Post
Re: Opening project very slow with files on network share
« Reply #5 on: September 25, 2008, 08:04:00 pm »
Okay, thanks guys.  I'm actually not using Code::Blocks to compile this project, so if there's some way to eliminate the dependency calculation that would work for me, but I don't see any way to do that.

I have no idea if this would work, but did you try un-checking compile and link properties on each file?

Note, then compiling or linking would not use those files.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cybertron

  • Single posting newcomer
  • *
  • Posts: 4
Re: Opening project very slow with files on network share
« Reply #6 on: September 25, 2008, 11:49:21 pm »
Okay, thanks guys.  I'm actually not using Code::Blocks to compile this project, so if there's some way to eliminate the dependency calculation that would work for me, but I don't see any way to do that.

I have no idea if this would work, but did you try un-checking compile and link properties on each file?

Note, then compiling or linking would not use those files.

Tim S
That sounds promising, but I'm not sure I'm willing to go through 3000 files and do that for each one. :?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Opening project very slow with files on network share
« Reply #7 on: September 26, 2008, 09:00:03 am »
That sounds promising, but I'm not sure I'm willing to go through 3000 files and do that for each one. :?
Use the C::B scripting engine to automise the process.
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

Offline cybertron

  • Single posting newcomer
  • *
  • Posts: 4
Re: Opening project very slow with files on network share
« Reply #8 on: September 26, 2008, 04:12:08 pm »
Ah, good point.  I'm still a Code::Blocks newbie obviously.:)