如何打开专业化以消除运行时词典通过?

发布于 2025-02-04 08:07:54 字数 270 浏览 4 评论 0原文

在查看我写过的一些PureScript代码的运行时性能不佳时,我注意到生成的JavaScript代码包含EG Transformers monads的过载定义的字典传递。但是,我所有的导出功能都是单态的,因此编译器应该毫无困难地专注于这些超载事件。

如果这是使用GHC编译的Haskell,我将检查优化标志,并且诸如确保没有标记的Noinline> nose> noinline ,并且适当地暴露了有关特定定义的事物。纯粹的纯种技术是什么?

While looking at poor runtime performance of some Purescript code I wrote, I noticed that the generated Javascript code contains dictionary passing for overloaded definitions for e.g. transformers monads. However, all my exported functions are monomorphic, so the compiler should have no trouble specializing these overloaded occurrences.

If this were Haskell compiled with GHC, I'd check optimization flags, and things like making sure nothing is marked NOINLINE and that unfoldings are properly exposed for specialisable definitions. What are the equivalent techniques for Purescript?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

旧竹 2025-02-11 08:07:55

purescript v0.15.3 对“表达式消除表达式消除的优化”由编译器在创建和使用的过程中创建
Typeclass字典。”也许这会加快您的代码。

PureScript v0.15.3 has an optimization for “common subexpression elimination for expressions created by the compiler in the process of creating and using
typeclass dictionaries.” Maybe that will speed up your code.

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