IntersectMBO / plutus-apps

The Plutus application platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve `walletState` by improving comparison of `wallet`s

koslambrou opened this issue · comments

Description

As a plutus-apps emulator user

I want an efficient version of walletState

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 following merge from next-node to main), walletState takes 2% 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 walletState:

walletState  Wallet.Emulator.MultiAgent  src/Wallet/Emulator/MultiAgent.hs:(246,1)-(247,120)  52551           0    0.1    0.1     1.0    1.6
 compare     Wallet.Emulator.Wallet      src/Wallet/Emulator/Wallet.hs:108:3-57               52584     3704890    0.0    0.1     0.9    1.5
  compare    Wallet.Emulator.Wallet      src/Wallet/Emulator/Wallet.hs:145:19-21              52585           0    0.8    1.4     0.8    1.4