tweag / cooked-validators

MIT License
39 stars 11 forks source link

Reduce test execution time by 95% #204

Closed steshaw closed 1 year ago

steshaw commented 1 year ago

WARNING: You may not want to merge this PR! However, I wanted to make you aware of the potential performance benefit.

This PR simply points the cabal.project to my fork of cardano-node. This fork is 1 commit ahead of 1.35.3. It contains a patch which memoises toBabbagePParams in order to improve performance. The performance issue with cardano-api is being tracked as https://github.com/input-output-hk/cardano-node/issues/4622. It's quite probable that there is a less brutal way to fix cardano-api. My patch is a bit of a hack.

With this PR:

Could make a big difference on full audit suites.

This patch doesn't help against main because the performance problem was introduced in the Babbage era. So, I found the active branch — ch/inlines-datums — which had upgraded to 1.35.3.

Note, I saw that 3 tests are failing in the cooked-validators test suite on this branch, but I figured that you are aware of that and it doesn't impact the performance improvement.

0xd34df00d commented 1 year ago

That's pretty cool, thanks for looking into this — the run time is something that we always wanted to improve but didn't find enough time to look carefully into!

Let's see if cardano-api gets this improved soon, and if it doesn't we might use your branch, at least for the more extensive audits.

steshaw commented 1 year ago

No worries, I had some time and this was fun 😁

steshaw commented 1 year ago

I should add that it was @etiennejf who pointed out that the bottleneck was toLedgerPParams.

carlhammann commented 1 year ago

We're now using this patch on the branch ch/hedge-v2, which is our main development branch for the Plutus V2 update.