如何打开专业化以消除运行时词典通过?
在查看我写过的一些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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.