-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): cache the sender address on mempool transactions (#1282)
**Motivation** Depends on #1273 When doing flamegraphs of load tests, the node spends around 50% of its time on the `fill_transactions` function, and in there spends most of its time just calling the `sender()` method to recover the sender's address. By caching it when it's first added to the mempool, the time spent on `fill_transactions` goes down to around 8%, and block execution becomes roughly ~7x faster Before the change: ![flamegraph_original](https://github.com/user-attachments/assets/d9e443f5-c151-4dfd-81c5-eef339ec8ca7) After the change: ![flamegraph_cached_sender](https://github.com/user-attachments/assets/076a79d7-6c46-4ec7-9456-8c819ddcb4f3) **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 -->
- Loading branch information
Showing
3 changed files
with
41 additions
and
16 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