Avatar for the FuelLabs user
FuelLabs
sway
BlogDocsChangelog

Performance History

Latest Results

Use `DeclEngine::insert_modified` instead of `replace` (#7717) ## Description This PR is a prerequisite for removals of duplicates from `DeclEngine` and for elimination of expensive hashing. The PR removes most of the usages of `DeclEngine::replace`, up to those used in `type_check_impl_self` and in `type_check_method_application` (the usage in `impl ReplaceFunctionImplementingType for DeclRefFunction` we consider to be a part of `type_check_impl_self`). Those remaining usages will be removed in a separate follow up PR. Beside being a show-stopper for `DeclEngine` improvements, `DeclEngine::replace` usage in the cases tackled in this PR was error-prone. Its callers assumed that the replaced `TyDecl` was not reused by different declarations. As the all passing tests confirm, this assumption currently holds. But note that we already had issues in the past with `TyConstantDecl` where replacing shared declarations was causing side-effects and causing bugs in the compilation. `impl SubstTypes for DeclId<TyConstantDecl>` was already using `insert_modified` instead of `replace` with a comment explaining why. This PR merely roles out that correct pattern to all `TyDecl`s. ## Checklist - [ ] I have linked to any relevant issues. - [ ] 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) - [ ] 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. - [x] 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.
master
4 hours ago
Add "implicits" to .typos.toml
ironcev/use-insert-modified-instead-of-replace
4 hours ago
fmt and clippy issues
xunilrj/decrease-back-jmps
10 days ago
improving reordering
xunilrj/decrease-back-jmps
10 days ago
Merge branch 'master' into ironcev/use-insert-modified-instead-of-replace
ironcev/use-insert-modified-instead-of-replace
10 days ago
fix typo
xunilrj/decrease-back-jmps
17 days ago
update tests
xunilrj/decrease-back-jmps
17 days ago

Latest Branches

CodSpeed Performance Gauge
0%
Use `DeclEngine::insert_modified` instead of `replace`#7717
4 hours ago
2f875e3
ironcev/use-insert-modified-instead-of-replace
CodSpeed Performance Gauge
-15%
Improve fn order to decrease fn call cost#7720
10 days ago
f544254
xunilrj/decrease-back-jmps
CodSpeed Performance Gauge
0%
22 days ago
13c816b
ironcev/fix-configurables-data-section-offset-issue
© 2026 CodSpeed Technology
Home Terms Privacy Docs