You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
This PR is a prequel for #7419.
It will set the baseline, which future PRs need to improve.
Apart from that it also:
1 - Fix a problem with `SubtsType` for `TyConstantDecl`;
2 - Introduce a new way to write snapshot tests. Now the test source
code can have "blocks"
```
/* START BOOL */
fn in_bool(v: bool) -> bool;
/* END BOOL */
```
These blocks can be manipulated from inside the `snapshot.toml`. In this
case, the `toml` is:
```
cmds = [
"forc test --path {root} --release --experimental const_generics",
{ repeat = "for-each-block", cmds = [
"forc test --path {root} --release --experimental const_generics"
] }
]
```
Which repeats the inner `forc test` for each block, removing all others.
That allows me to check the cost of the contract method selection
algorithm for each contract method.
For example, `cost_of_in_array_64` with all other contract methods costs
`60382`, but alone it only costs `58218`, which means that around 2000
was "wasted" in the contract method selection.
## Checklist
- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
0 commit comments