Optimize AccountCode equality comparison performance
オープン
- 主要言語
- Rust
- スター
- 132
- フォーク
- 167
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 110
説明
The PartialEq implementation for AccountCode compares the entire MastForest, which is slow for large code structures.
Since commitment uniquely identifies the account code (and is already used for Ord), we should use it for equality checks instead of comparing the full MastForest.
Current code:
`self.mast == other.mast && self.procedures == other.procedures`
Expected change:
Compare by commitment and procedures instead of mast and procedures.
There's already a TODO comment in the code suggesting this optimization (line 234). This should improve performance without changing correctness, since commitment is deterministic and uniquely identifies the code interface.
コントリビューションガイド
評価
この issue はまだ評価されていません。