IntersectMBO / plutus-apps

The Plutus application platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve performance of `makeTransactionBody`

koslambrou opened this issue · comments

Description

As a plutus-apps emulator user

I want an efficient version of makeTransactionBody

so that I waste as little time as possible when I run the emulator.

Technical details

After the first investigation of https://input-output.atlassian.net/browse/PLT-1026 (emulator performance regression after merging next-node to main), makeTransactionBody takes 5% of the time of a whole plutus-use-cases run.

Here is an excerpt of the prof file that illustrates the costs of the calls inside makeTransactionBody:

makeTransactionBody                          Ledger.Validation                                        src/Ledger/Validation.hs:(305,1)-(308,91)             364072        4540    0.0    0.0     1.7    2.2
 getTxExUnitsWithLogs                        Ledger.Validation                                        src/Ledger/Validation.hs:(285,1)-(298,97)             364076        4540    0.0    0.0     1.5    2.0
  evaluateTransactionExecutionUnitsWithLogs  Cardano.Ledger.Alonzo.Tools                              src/Cardano/Ledger/Alonzo/Tools.hs:(166,1)-(234,66)   364077        4540    0.0    0.0     1.3    1.8
   evaluateScriptRestricting                 Plutus.V1.Ledger.Api                                     src/Plutus/V1/Ledger/Api.hs:179:1-69                  369620           0    0.0    0.0     1.3    1.8