Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

emacs+cscope速度太慢的解决方法

97 views
Skip to first unread message

虫子

unread,
Dec 30, 2008, 4:25:16 AM12/30/08
to
用的xcscope.el信息如下
$RCSfile: xcscope.el,v $ $Revision: 1.14 $ $Date: 2002/04/10 16:59:00 $ $Author: darrylo $

慢的原因有两个,
1。发生如下错误
cscope: -q option mismatch between command line and old symbol database
也就是删除了原来的数据库文件,生成没有使用-q选项的数据库文件。
2。每次使用cscope-find-this-symbol都要update数据库文件,相当慢。

解决方法
在文件xcscope.el第1981行
;; Add the correct database file to search
(setq options (cons base-database-file-name options))
(setq options (cons "-f" options))

在上面的注释之后加上下面这行
(setq options (cons "-dqk" options))

-q的意思是生成反向索引表表加快查找速度
-d的意思是防止更新交叉引用表
-k是不使用默认的include dir 如/usr/include

通过以上措施,大的工程使用cscope-find-this-symbol也能在0.01秒得到结果

--

[m [1;31m※ 来源:·水木社区 newsmth.net·[FROM: 16.130.28.*] [m

大猪·最爱小猪

unread,
Dec 30, 2008, 8:26:05 AM12/30/08
to
大的工程大到什么程度呢?

【 在 ycwu (虫子) 的大作中提到: 】
: 用的xcscope.el信息如下


: $RCSfile: xcscope.el,v $ $Revision: 1.14 $ $Date: 2002/04/10 16:59:00 $ $Author: darrylo $
: 慢的原因有两个,

: ...................

--
[1;31m.:: [0m欢迎访问 [1;31m: [0m我的主页 [1;31m::. [0m
http [1;33m: [0m//www.rootshell.be/~stid/ ( [33mXHTML [0m& [33mCSS [0mValidated)
[1;36m.:: [0m敬请评论 [1;36m: [0m我的blog [1;36m::. [0m
http [1;32m: [0m//stid.cublog.cn/


[m [1;37m※ 来源:·水木社区 newsmth.net·[FROM: 114.243.118.*] [m

|笑渐不闻声渐悄

unread,
Dec 30, 2008, 9:09:35 PM12/30/08
to
我用xcscope管理webkit没问题
【 在 stid (大猪·最爱小猪) 的大作中提到: 】
: 大的工程大到什么程度呢?


--

[m [1;33m※ 来源:·水木社区 newsmth.net·[FROM: 211.155.235.*] [m

Brian Jiang

unread,
Dec 30, 2008, 10:30:08 PM12/30/08
to
cscope的options菜单里面有两项:
Never update cscope database
Index recursively

不知道能不能满足你的要求?

【 在 ycwu (虫子) 的大作中提到: 】
: 用的xcscope.el信息如下
: $RCSfile: xcscope.el,v $ $Revision: 1.14 $ $Date: 2002/04/10 16:59:00 $ $Author: darrylo $
: 慢的原因有两个,
: ...................

--

[m [34m※ 来源:·水木社区 http://newsmth.net·[FROM: 218.19.175.*] [m

大猪·最爱小猪

unread,
Dec 31, 2008, 8:35:46 AM12/31/08
to
那修改文件之后还需要手工做index吗?还是自动就会?

【 在 jcjbrian (Brian Jiang) 的大作中提到: 】
: cscope的options菜单里面有两项:


: Never update cscope database
: Index recursively

: ...................

--
[1;31m.:: [0m欢迎访问 [1;31m: [0m我的主页 [1;31m::. [0m
http [1;33m: [0m//www.rootshell.be/~stid/ ( [33mXHTML [0m& [33mCSS [0mValidated)
[1;36m.:: [0m敬请评论 [1;36m: [0m我的blog [1;36m::. [0m
http [1;32m: [0m//stid.cublog.cn/


[m [1;32m※ 来源:·水木社区 newsmth.net·[FROM: 114.241.164.*] [m

lgfang

unread,
Feb 26, 2009, 9:32:29 AM2/26/09
to
我的作法是:
1. 修改 cscope-indexer,生成 cscope.out 时用 -q 选项
2. .emacs里加上 (setq cscope-do-not-update-database t)

>>>>> "虫子" == 虫子 <yc...@newsmth.net-SPAM.no> writes:

虫子> 用的xcscope.el信息如下$RCSfile: xcscope.el,v $ $Revision:
虫子> 1.14 $ $Date: 2002/04/10 16:59:00 $ $Author: darrylo $

虫子> 慢的原因有两个, 1。发生如下错误cscope: -q option mismatch
虫子> between command line and old symbol database 也就是删除了原来
虫子> 的数据库文件,生成没有使用-q选项的数据库文件。2。每次使用
虫子> cscope-find-this-symbol都要update数据库文件,相当慢。

虫子> 解决方法在文件xcscope.el第1981行;; Add the correct database
虫子> file to search (setq options (cons base-database-file-name
虫子> options)) (setq options (cons "-f" options))

虫子> 在上面的注释之后加上下面这行(setq options (cons "-dqk"
虫子> options))

虫子> -q的意思是生成反向索引表表加快查找速度-d的意思是防止更新交叉
虫子> 引用表-k是不使用默认的include dir 如/usr/include

虫子> 通过以上措施,大的工程使用cscope-find-this-symbol也能在0.01秒
虫子> 得到结果

虫子> --

虫子> [m[1;31m※ 来源:·水木社区 newsmth.net·[FROM:
虫子> 16.130.28.*][m

--
lgfang

0 new messages