Eclipse有两个C / C ++索引(快&安培;满):有什么区别? [英] Eclipse has two C/C++ indexers (fast & full): what's the difference?

查看:150
本文介绍了Eclipse有两个C / C ++索引(快&安培;满):有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse CDT的提供了两个索引的C / C ++ code(preferences> C / C ++>索引)。有谁知道确切的有什么区别这两者之间?

Eclipse CDT provides two indexers for C/C++ code (Preferences > C/C++ > Indexer). Does anybody know what the exact difference is between these two?

帮助文件是不完全的启发:

The help file isn't exactly enlightening:

CDT支持的贡献
  附加索引,用2索引
  被提供具有默认的CDT
  发布:

"CDT supports the contribution of additional indexers, with 2 indexers being provided with the default CDT release:


      
  • 快速的C / C ++索引器:提供最快的索引功能 - 无论是
      声明和交叉引用
      信息。这是推荐的
      索引器。

  • Fast C/C++ Indexer : provides fastest indexing capabilities - both declarations and cross reference information. This is the recommended indexer.

完整的C / C ++索引器:提供更准确的索引
  在成本能力
  性能 - 无论声明和
  交叉参考信息。

Full C/C++ Indexer : provides even more accurate indexing capabilities at the cost of performance - both declarations and cross reference information."

这是什么意思更加的准确的:?它的索引更多的东西,如果是哪些

What does it mean to be more accurate: does it index more things, and if so which ones?

推荐答案

下面是从CDT页面描述他们的分析和索引(的 CDT /设计/解析的概述)。它提供了pretty什么样的差异和很好的说明,其中快速索引器可能失败:

Here is an excerpt from the CDT page describing their parsing and indexing(CDT/designs/Overview of Parsing). It gives a pretty good description of what the differences are and where the fast indexer can fail:

解析和约束力的决议是一个
  缓慢的过程,这是一个问题
  因为用户希望code编辑
  功能,如内容辅助是
  快速。为此CDT存储
  在磁盘上的绑定信息
  缓存称为指数或PDOM
  (持久文档对象模型)的
  为了能够提供的功能
  该快速响应用户的请求。

Parsing and binding resolution is a slow process, this is a problem because the user expects code editing features such as content assist to be fast. For this reason CDT stores binding information in an on-disk cache called "the index" or "the PDOM" (Persisted Document Object Model) in order to be able to provide features that respond quickly to user requests.

构建指数涉及解析
  所有code在一个项目中,解决
  所有的绑定和那些写
  绑定到索引。该指数是
  然后增量更新,每次
  用户编辑一个文件。

Building the index involves parsing all the code in a project, resolving all the bindings and writing those bindings to the index. The index is then incrementally updated every time the user edits a file.

旧版本的CDT支持三种
  不同的索引方式,速度快
  索引,索引完全没有
  索引。默认设置是
  快速索引,因为一个索引
  大型项目可能是一个耗费时间
  处理。之间的差
  快速和完整的索引是,
  快速索引器将跳过头文件
  那些已经被解析一次,
  而全索引总会
  每次重新解析头文件它
  被包括在内。然而,它是重要的
  要明白,完整索引,
  尽管它的名字,还没有完全
  准确的。

Older versions of CDT support three different indexing modes, fast indexing, full indexing and no indexing. The default setting being the fast indexer because indexing a large project can be a time consuming process. The difference between the fast and full indexers is that the fast indexer will skip header files that have already been parsed once, while the full indexer will always re-parse a header file every time it is included. However it is important to understand that the full indexer, despite its name, is still not fully accurate.

当被包括在一个标题文件
  源文件是不受任何
  已经在这个被定义的宏
  点。一些库头使用宏
  在preprocessor结合
  条件式(的#ifdefs)部分地
  包含头文件。有时候,这些
  一个头文件包含多于
  曾经在一个项目中,如果宏
  标题取决于不同
  每次包括头,然后时间
  头的不同部分可以是
  包括在不同的源文件。
  无论索引将在准确
  这种情况下,因为它只会
  索引的标题中的第一个时间,它是
  遇到过。

When a header file is included in a source file it is subject to any macros that have been defined at that point. Some library headers use macros in conjunction with preprocessor conditionals (#ifdefs) to partially include a header file. Sometimes such a header file is included more than once in a project, if the macros that the header depends on are different each time the header is included then different parts of the header may be included in different source files. Neither indexer will be accurate in this scenario because it will only index the header the first time it is encountered.

完整索引将重新解析头
  它已经遇到过,但它
  不会重新索引它们。因此
  源文件,其中包括一个头可能
  更精确地分析,但在
  头本身将只被索引的
  一次。完整的索引是多少
  比快速索引,因为慢
  额外的解析它,但它
  只是勉强更加准确。对于
  为此,全索引不
  推荐并从已被删除
  当前版本的CDT。

The Full indexer will re-parse headers it has already encountered, but it will not re-index them. Therefore source files that include a header may be parsed more accurately, but the header itself will only be indexed the one time. The full indexer is much slower than the fast indexer because of the extra parsing it does, but it is only marginally more accurate. For this reason the Full indexer is not recommended and has been removed from the current version of CDT.

每个项目都有一个PDOM
  与之相关联。该PDOM存储
  在磁盘上,一个平面的二进制文件。该
  索引只会指数标头
  由源文件都包括在内,因此,如果
  有一个在项目中的.h文件
  没有被列入任何.C或
  .cpp文件,然后正常就不会得到
  索引。然而,有一个preference
  设定为索引中的所有文件
  项目。

Each project has a single PDOM associated with it. The PDOM is stored on disk as a flat binary file. The indexer will only index headers that are included by source files, so if there is a .h file in the project that is not being included by any .c or .cpp file, then normally it won’t get indexed. However there is a preference setting for indexing all files in the project.

这篇关于Eclipse有两个C / C ++索引(快&安培;满):有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆