Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Inlining Daml codeForum ↗

Inlining Daml code

App Development5 posts137 views4 likesLast activity Nov 2022
LE
Leonid_RozenbergOP
Nov 2022

Asking for a friend, does Daml’s GHC portion respect the INLINE pragma? Ex.

lift : Action m => m a -> ContT r m a
lift m = ContT (m >>=)
{-# INLINE lift #-}
CO
cocreature
Nov 2022

No it does not. There is very limited inlining for typeclass methods that are statically known but generally my recommendation is that you assume the Daml compiler does not optimizations on your code at all and what is being run is what you write.

LE
Leonid_Rozenberg
Nov 2022

709amm

Obviously, you’re Batman, I’m Robin.

BE
bernhard
Nov 2022

I wouldn’t worry about optimising the CPU time of Daml interpretation too much. In the grand scheme of things, that does not tend to be the bottleneck unless your algorithmic complexity is out of whack.

LE
Leonid_Rozenberg
Nov 2022

709hpu

Bernhard’s Batman … I’m still Robin

← Back to Discussions