CEDET语义分析器在速度快的系统上相当慢

时间:2011-02-04 22:29:10

标签: emacs cedet emacs-semantic

我的测试设置: Intel双核3GHz,Windows XP 32位,Emacs 23.2.1,CEDET v1.0(按照INSTALL文档中的描述进行字节编译)。

Emacs init文件只包含以下四行:

(load "~/vendor/cedet/common/cedet.el")
(semantic-load-enable-code-helpers)
(require 'semantic-ia)
(global-ede-mode 1)

当打开仅包含一个函数的C ++文件时,通过(semantic-ia-complete-symbol)完成一个函数只有在明显滞后之后才会完成,即使在重复尝试之后也是如此。

评估semantic-analyze-current-context表明迟钝是由语义分析器引起的。

这是semantic-elp-analyze多次运行后ELP result file,而不更改缓冲区中的点。总耗用时间总是 0.6秒

当我添加包含#include <stdio.h>的包含语句时,时间会更改为 2.5秒。这是相应的ELP result

在我的linux环境中,相同的基准测试永远不会超过0.1秒。 (相同的硬件,Debian的23.1 Emacs,CEDET v1.0)

我的设置可能有什么问题?

1 个答案:

答案 0 :(得分:3)

原来,编译CEDET引发了一堆我最初没有注意到的错误:

semantic-analyze.el:178:1:Error: Symbol's value as variable is void: filename

哪个导致减速81个文件未编译。

Google suggests此错误可能与23.1以上的Emacs版本有关。

如果您使用cedet-build.el编译CEDET,请尝试以下解决方法:

Add (setq filename nil) to the beginning of cedet-build.el