4

在独立运行 Dialyzer 时,它会使用 HiPE 编译其模块,以加快分析速度:

dialyzer --src -r .
  Checking whether the PLT /home/foo/.dialyzer_plt is up-to-date... yes
  Compiling some key modules to native code... done in 0m12.27s
  Proceeding with analysis...

当需要分析许多模块时,这会对运行时间产生很大影响。

rebar3 dialyzer运行命令时 Rebar3 会这样做吗?该文档没有说一种或另一种方式。

4

2 回答 2

3

正如 Dogbert 在评论中提到的,rebar3 中的默认设置是使用源格式。原生版本有一个待处理的拉取请求(https://github.com/erlang/rebar3/pull/1493)在可用时切换到 HiPE 格式,但在 rebar3 的上下文中,非原生版本的基准测试为更快和到目前为止,我们还没有合并它。

我刚刚更新了那里的 PR 讨论,看看是否即使默认未启用它也不能包含在内。

于 2017-05-14T19:52:06.067 回答
1

很久以后再回到这一点,从 Erlang/OTP 22.0.6 开始,HiPE 编译功能已从 Dialyzer 中删除,因此 Rebar3 无法激活该功能。从发布公告

  OTP-15949    Application(s): dialyzer, hipe

               *** POTENTIAL INCOMPATIBILITY ***

               The HiPE compiler would badly miscompile certain
               try/catch expressions, so it will now refuse to compile
               modules containing try or catch.

               As a consequence of this, dialyzer will no longer
               compile key modules to native code.

此外,根据这个邮件列表线程,HiPE 将在 Erlang/OTP 24 中完全删除。它是在这个 pull request中完成的。

于 2019-10-04T16:30:07.650 回答