IntersectMBO / IntersectMBO/plutus

Speed `defaultCekParameters*` back up?

Open
#6,180 1 comment 0 reactions 0 assignees View on GitHub
Evaluation Internal Performance status: triaged tech debt Test
Dominant language
Haskell
Stars
1.6k
Forks
508
Avg merge
3d 10h
Merged PRs (30d)
22

Description

This:

```haskell
defaultCekParametersA :: Typeable ann => MachineParameters CekMachineCosts DefaultFun (CekValue DefaultUni DefaultFun ann)
defaultCekParametersA =
noinline mkMachineParameters DefaultFunSemanticsVariantA cekCostModelVariantA
```

and other such `defaultCekParameters*` definitions are artificially slowed down with that `noinline` call, so that if we use them anywhere where performance matters, we can spot it right away. But we use this definition a lot in tests and so many our tests are artificially slowed down. This is perhaps a waste of resources. Should we remove the `noinline` call? But then there's no guarantee that we won't get the same slowdown accidentally, since performance of those definitions isn't checked anywhere. And it probably won't even work properly now, because inlining machine parameters for each semantics variant will produce dozens of thousands of lines of code and GHC may simply give up trying to optimize all of that.

Or should we "simply" use the production `mkMachineParametersFor` everywhere including tests? That would reliably give us proper performance. The issue is with the "simple" part as that would me a major overhaul of tests. At least we can do it incrementally I suppose.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.