-
Notifications
You must be signed in to change notification settings - Fork 502
Open
Labels
Low priorityDoesn't require immediate attentionDoesn't require immediate attentionPlinth Pluginoptimizationstatus: triaged
Description
Check: #7199 (comment)
The plugin will create extra binding to ensure evaluation of all the argument of a given function currently. However, this is not necessary for arguments whose types are function. This can be fixed by either/or of these two approaches: Changing plutus-tx-plugin to not generate binding when it compiles Haskell code into pir or having an extra optimization path that will take out bindings of function-typed function argument.
Example:
foo :: (Integer -> a) -> a
foo f = f 10
-- Compiles into (pseudocode)
foo = /\a -> \(f: Integer -> a) ->
let !f = f
in f 10
-- here we don't need this extra binding, it can simply be
foo = /\a -> \(f: Integer -> a) -> f 10More complicated example can be found here: https://github.com/IntersectMBO/plutus/pull/7199/files#r2202044342
Unisay
Metadata
Metadata
Assignees
Labels
Low priorityDoesn't require immediate attentionDoesn't require immediate attentionPlinth Pluginoptimizationstatus: triaged