Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: cybertron on September 23, 2008, 08:48:50 pm

Title: Opening project very slow with files on network share
Post by: cybertron 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.
Title: Re: Opening project very slow with files on network share
Post by: Jenna 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 ?
Title: Re: Opening project very slow with files on network share
Post by: thomas 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.
Title: Re: Opening project very slow with files on network share
Post by: cybertron 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.
Title: Re: Opening project very slow with files on network share
Post by: MortenMacFly 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. ;-)
Title: Re: Opening project very slow with files on network share
Post by: stahta01 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
Title: Re: Opening project very slow with files on network share
Post by: cybertron 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. :?
Title: Re: Opening project very slow with files on network share
Post by: MortenMacFly 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.
Title: Re: Opening project very slow with files on network share
Post by: cybertron on September 26, 2008, 04:12:08 pm
Ah, good point.  I'm still a Code::Blocks newbie obviously.:)