forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performance of liveness analysis in the register allocator (4…
….3X) (FuelLabs#3913) - Switch to using a `Vec` instead of `HashMap` since the key was an index anyways. - When finding the successors, use a `label_to_index` hash map instead of looking for the index every time. - Update how `modified` is computed and reduce the amount of things copied around. I double checked that the bytecode size is unchanged for several small and large designs so I know that the allocator is not less efficient in that sense. For https://github.com/sway-libs/concentrated-liquidity, the improvements are as follows for the IR -> final bytecode step: - Before this change: 42.72 seconds - After this change: 9.88 seconds **for a 4.3X improvement.** > **Note: Combining this PR with FuelLabs#3898 and FuelLabs#3909, the total cost of converting the final IR to final bytecode goes down from ~263s to ~10s for a 26.3X improvement.**
- Loading branch information
1 parent
4131a16
commit 3c0c024
Showing
2 changed files
with
46 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters