Cross-posting to semantic mailing list.
Ashish

---------- Forwarded message ----------
From: Ashish Hanwadikar < ahanwadi@gmail.com>
Date: Jun 21, 2007 8:03 PM
Subject: using semantic on large projects
To: cedet-devel@lists.sourceforge.net

I am trying to setup semantic intellisense for a large project (possibly more than 1000 files). It is extremely slow and thus, unusable in the current state. The relevant .emacs is at the end of this email. I found out using 'strace' that it is trying to locate the include file (say, include <b/a.h>) in my project. The algorithm seems to be the following:
1) try, current directory/b/a.h -- Not found
2) then, current directory/a.h -- Not found
3) the, for each subdirectory in the system include path, try, system include dir/subdir/b/a.h -- Not found

The last step, takes a lot of time as it has to through hundreds of sub directories. Just like the step 1), why doesn't it directly try, system include dir/b/a.h? It will find that file immediately.

I don't know enough lisp to fix this. But if somebody can point to me where I should be looking for, I am willing to give it a try.

thanks in advance,
Ashish Hanwadikar


;; -*- emacs-lisp -*-

;; Pre-define some values so we don't intersect w/ my regular setup
(setq semanticdb-default-save-directory (expand-file-name "~/.semanticdb-test")
      semanticdb-default-file-name "semantic-test.cache "
      semanticdb-default-system-save-directory semanticdb-default-save-directory)

(add-to-list 'load-path "~/downloads/cedet")
(add-to-list 'load-path "~/downloads/cedet/semantic")
(add-to-list 'load-path "~/downloads/cedet/common")

;; Default CEDET setup.
(load-file "~/downloads/cedet/common/cedet.el")
(semantic-load-enable-code-helpers)
(load-file "~/downloads/cedet/semantic/semantic- load.el")
(setq semantic-imenu-auto-rebuild-directory-indexes nil)

;; Get the C parser in due to mode-local bug I just found
(require 'semantic-c)

;; Post load changes needed for clean workings w/in the linux kernel
(setq-mode-local c-mode
         semanticdb-find-default-throttle
         '(project unloaded system recursive))

(setq semanticdb-project-roots '("/path/to/the/root/of/my/project"))

(defun semantic-c-mode-hook ()
       (semantic-reset-system-include)
       (semantic-add-system-include "/path/to/the/root/of/my/project/src/include")
)

(add-hook 'c-mode-common-hook 'semantic-c-mode-hook)
(add-hook 'c-mode-hook 'semantic-c-mode-hook)
(add-hook 'c-mode-common-hook 'semantic-default-c-setup)

(global-semantic-idle-completions-mode 1)
(require 'semantic-ia)
(require 'semantic-analyze)

--
Ashish Hanwadikar
Web: http://ashish.typepad.com/ashishs_niti


--
Ashish Hanwadikar
Web: http://ashish.typepad.com/ashishs_niti