Cscopeegrep加速

发布于 2024-08-02 17:11:15 字数 125 浏览 4 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╰つ倒转 2024-08-09 17:11:15

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文