0xMiden / 0xMiden/protocol

Optimize AccountCode equality comparison performance

オープン
#2,429 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。