Author Topic: Slow symbols "re-parse" when over ssh  (Read 7277 times)

Offline nickname

  • Single posting newcomer
  • *
  • Posts: 5
Slow symbols "re-parse" when over ssh
« on: October 03, 2014, 03:09:43 pm »
Hello to all,

I have a (huge) time consuming issue that i want to share with you.

The source code is on a dev machine and I locally mount the files on windows using "SFTP net drive free".
The project is pretty big with many different files and the connection with the dev machine is pretty slow.

After the first time I create a project and add file to it (it takes some hours) I go to the Symbols tab on the management window and I open the view on "Current project's symbols" in order to "index" all the functions and variables that are created on the project. That also takes some hours (around 3). The problem is as I mentioned because the project is pretty big and the connection is pretty slow.

The problem is that every time that I close the application and reopen it the "indexing" of the functions and variables are lost and it has to re-parse it again! (calling CreateParser() as I see on code::blocks log tab).

It's a common issue here for all the developers with many different IDE's (netbeans, eclipse etc).

I want to ask if there is a way to save the "index" somehow and load it instead of creating it again when I reopen IDE. And to re-parse it manually and only on the files that are modified.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Slow symbols "re-parse" when over ssh
« Reply #1 on: October 03, 2014, 03:43:24 pm »
Parsing(indexing) files are open every files in the project, and run syntax analysis on those files. So, if you have very slow speed to open the files, the parsing time is quite slow.

You want to create a cache to save the "symbol database" to your local computer, so the parsing don't happens the next time when you open the project. As far as I know,  C::B don't have this feature for now. (Although I see that there are some function in C::B code to serialize the TokenTree to harddisk, but I don't see any code actually call them)

My suggest is that you can copy the project to your harddisk.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nickname

  • Single posting newcomer
  • *
  • Posts: 5
Re: Slow symbols "re-parse" when over ssh
« Reply #2 on: October 03, 2014, 03:53:38 pm »
hi,
that is exactly my problem!! When I have them locally the parsing is completed really fast (less than a minute).

Unfortunately to have them and edit them locally is not an option because they need to be compiled on the dev machine. And to upload the whole project every time I want to compile it is not an efficient solution...

...except if you know a way to automatically synchronize  (upload) ONLY the edited files to the dev machine.

Thanks a lot for your reply!
« Last Edit: October 03, 2014, 03:57:02 pm by nickname »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Slow symbols "re-parse" when over ssh
« Reply #3 on: October 03, 2014, 03:58:31 pm »
Hi, why not use a version control system? Such as SVN, GIT, they can only transmit the changed files between your local computer and the remote server.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nickname

  • Single posting newcomer
  • *
  • Posts: 5
Re: Slow symbols "re-parse" when over ssh
« Reply #4 on: October 03, 2014, 04:11:32 pm »
the files on the dev machines are downloaded using svn from the official code of the company. (so iI had in mind to keep same revision locally and on the dev and to upload the modified files from the laptop to the dev)

I am not sure how two different svn's on the same files will work but I will give it a try.

Again thanks!

P.S. the solution they "using" here is...never close the IDE...  ;D
(or use vim on the dev machines)

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Slow symbols "re-parse" when over ssh
« Reply #5 on: October 03, 2014, 06:01:03 pm »
You can use the following to sync your local files with the ones on the server as long as you can mount your dev machine as a network drive (I only use it on Windows but I'm sure it is the same in linux). It can even work on both directions.
http://freefilesync.sourceforge.net/

Offline nickname

  • Single posting newcomer
  • *
  • Posts: 5
Re: Slow symbols "re-parse" when over ssh
« Reply #6 on: October 06, 2014, 12:53:03 pm »
I am giving a try to freefilesync and it seems to be the most efficient solution.
By time I will target the folders I (mostly) modify in order to look for modified files in them instead of the whole project (now takes around 10 minutes).

Still i think that is going to be a nice addition to code:blocks to save the "symbol database" and re-parse it only manually.
On the other hand maybe my problem is very uncommon.

Anyway Thanks a lot  everyone for your help!!!!