-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf!: reduce cloning, add inline attribute (#78)
* Refactor `Fraction` methods to reduce cloning Revise the `Fraction` and `CurrencyAmount` methods to reduce unnecessary cloning and improve performance. Add trait constraints and modify functions to work with references, enhancing code efficiency and maintainability. * Refactor to reduce unnecessary cloning Updated methods to return references instead of owned values and removed redundant clone operations. This should reduce unnecessary heap allocations and improve performance by minimizing malloc overhead. * Add inline attributes to improve function call performance Annotated various functions and methods with #[inline] to suggest the compiler perform inline expansion, potentially enhancing performance for frequently called operations. This change spans across multiple modules, including token, weth9, base_currency, currency_amount, percent, fraction, price, compute_price_impact, and ether.
- Loading branch information
Showing
12 changed files
with
210 additions
and
77 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
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
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
Oops, something went wrong.