Cscopeegrep加速
我在 vim 中使用 cscope 在大型代码库中搜索内容。我发现 "cs f e"
选项太慢。无论如何,提示可以加快速度。我使用 cscope -bq
构建我的 cscope 数据库
I use cscope in vim to search for stuff in a large codebase. I find the "cs f e"
option too slow. Anyway tips speed it up. I build my cscope database using cscope -bq
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
cscope 不会(几乎)通过数据库加速 grep 和egrep。这是因为 cscope 不会为任何可能的子字符串构建任何倒排索引,也不会使用某些正则表达式加速技术和某种类型的预计算索引。唯一的加速是 cscope 将仅在源文件上运行 grep/egrep 函数,并且仅在与 grep regex -r . (也将检查二进制文件 .obj、.exe)进行比较时才会加速。
Egrep 函数无法使用 cscope 数据库。
因此,将代码移至本地文件系统(从网络文件系统),安装更多内存,通过 env LC_ALL=C 或 LC_ALL=POSIX 禁用整理,在文件系统上禁用 atime。
您还可以将文件系统移动到 SSD 或 RAMDISK。
cscope will not speedup grep and egrep with database (almost). This is because cscope will not build any inverted index for any possible substring nor will use some regex-speedup technique with some type of precomputed index. The only speedup is that cscope will run grep/egrep function only on source files and this is speedup only when comparing with
grep regex -r .
(which will check binaries .obj, .exe too).Egrep function can't use cscope database.
So, move your code to local fs (from network fs), install more memory, disable collating via env LC_ALL=C or LC_ALL=POSIX, disable atime on your fs.
You can also move your fs to SSD or RAMDISK.