0xMiden / 0xMiden/protocol

Optimize AccountCode equality comparison performance

Đang mở
#2,429 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
132
Fork
167
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
110

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.