Avatar for the FuelLabs user
FuelLabs
sway
BlogDocsChangelog

Performance History

Latest Results

Fix Clippy and fmt issues
vaivaswatha/aggr_init_mostly_zero
2 hours ago
improve U256 to hex display formatting
xunilrj/removing-cli-verify
17 hours ago
Use single `store` for single-store-initializeable aggregates
vaivaswatha/aggr_init_mostly_zero
2 days ago
update tests
xunilrj/removing-cli-verify
4 days ago
update tests
xunilrj/removing-cli-verify
4 days ago
fix CI using verify-ir
xunilrj/removing-cli-verify
4 days ago
Optimize type casting by using `__transmute` instead of `asm` blocks (#7675) ## Description This PR improves gas costs and bytecode sizes by consistently replacing `asm`-based conversions of _reference types_ in `std` with `__transmute`. Note that **copy-types are still converted using `asm` blocks**, because currently we didn't extend `__transmute` to handle copy-types without demoting transmuted values to stack and actually casting pointers. This gives a performance penalty when transmuting copy-types which we don't want to have. As expected, removing `asm` blocks unlocked existing IR performance optimizations and resulted in performance improvements given in the comment below. Note that we might think of temporarily forbidding using `__transmute` with copy-types until it is properly supported. But we have code in `ops.sw` where `__transmute` must be used to convert between copy-types, because the operator trait methods must be const-evaluable and if they use `asm` for conversion, they cannot be. Historically, making them const-evaluable was the reason for adding `__transmute` in the first place. Note that in the future, we plan to improve IR optimizations by letting them be aware of "safe `asm` blocks". Pure conversion blocks will be considered safe. That improvement would likely bring the same performance benefits as rolling out `__transmute`, but: - it will take some time before we get it implemented, - regardless, `__transmute` is the expected way to convert types and we should use it consistentlty across the codebase. Note that the PR changes snapshot files in the `sway-ir` tests. These changes are not related to this PR, but likely to the snapshots not being updated because of the `insta` checks being silent. For more info see https://github.com/FuelLabs/sway/pull/7666#pullrequestreview-4589675640. ## Checklist - [x] 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
5 days ago

Latest Branches

CodSpeed Performance Gauge
0%
Optimize initialization of mostly zeroed aggregates#7542
2 hours ago
7646c14
vaivaswatha/aggr_init_mostly_zero
CodSpeed Performance Gauge
0%
17 hours ago
93f2863
xunilrj/removing-cli-verify
CodSpeed Performance Gauge
0%
fix modified in optimisation passes so they converge#7666
11 days ago
5946264
xunilrj/fix-opt-passes-convergence
© 2026 CodSpeed Technology
Home Terms Privacy Docs