React Native 中的 Hermes 引擎是否需要缩小文件作为输入?

Does Hermes engine in React Native need a minified file as an input?

目前(至少从 0.64-rc.3 开始),React Native 首先在源上运行 Metro Bundler / Uglify,然后将缩小的 jsbundle 传递给 hermesc。我注意到在我的至少 2 个项目中禁用 Metro 中的 Uglify 步骤大大加快了 Hermes 编译步骤。

问题是:Hermes 是否需要缩小源?

直觉上,这根本不重要,因为 Uglify 不执行任何死代码剥离或其他 AST 优化。但我的理解可能遗漏了一些关键细节。

根据Tzvetan Mikov (Hermes project lead), who has kindly answered this question on Github,Hermes不需要任何预缩小:

No, Hermes doesn't need minified input. Minifiers primarily rename local variables and parameters and perform some simple AST transformations, which have very little, if any, impact on the size and performance of a compiled Hermes bundle. We recommend disabling minification with Hermes, but haven't really pushed for it aggressively since the Metro pipeline also supports JSC which does benefit from minification.