Skip to content
CCPEDIAby Unity Nodes
App Development

Inlining Daml code

5 posts176 views4 likesLast activity Nov 2022

  1. Leonid_RozenbergOP

    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 #-}
    
  2. cocreature

    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.

  3. Leonid_Rozenberg 2

    709amm

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

  4. bernhard 1

    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.

  5. Leonid_Rozenberg 1

    709hpu

    Bernhard’s Batman … I’m still Robin