【问题标题】:Does Rebar3 compile Dialyzer modules with HiPE?Rebar3 是否使用 HiPE 编译 Dialyzer 模块?
【发布时间】:2020-12-15 18:05:17
【问题描述】:

在独立运行 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 会这样做吗? documentation 并没有这么说。

【问题讨论】:

标签: erlang dialyzer rebar3


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    回到这一点很久以后,从 Erlang/OTP 22.0.6 开始,HiPE 编译功能已从 Dialyzer 中删除,因此 Rebar3 无法激活该功能。来自the release announcement

      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.
    

    此外,根据this mailing list thread,HiPE 将在 Erlang/OTP 24 中完全删除。它已在this pull request 中完成。

    【讨论】:

      猜你喜欢
      • 2018-01-27
      • 2017-02-04
      • 2014-12-26
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-29
      • 2021-08-20
      相关资源
      最近更新 更多