0xMiden / 0xMiden/protocol

Investigate optimizing adding and removing assets to account vault

オープン
#1,715 コメント 0 件 リアクション 3 件 担当者 0 名 GitHub で見る
kernels
主要言語
Rust
スター
132
フォーク
167
平均マージ
1日 23時間
マージ済み PR(30日)
110

説明

Removing (and presumably adding) an asset with `account::remove_asset_from_vault` currently takes about 1000 cycles in the VM. The main driver is `account_delta::remove_asset` which takes 753 cycles. Within that, the main driver are `link_map` operations. `account_delta::remove_fungible_asset` takes 562 cycles in total for the simple benchmark. Of those cycles these are the contributions:
- `link_map::get` -> 249 cycles
- `link_map::set` -> 302 cycles

Within the `set` procedure, `insert_after_entry` is most expensive with 235 cycles while the others take something like ~50 cycles. We could look into whether offloading more work to the host can make this more efficient by reducing the number of checks the procedure needs to do, but more investigation is needed to find the main driver of the cycle count.

Context: https://github.com/0xMiden/miden-base/pull/1705#discussion_r2260794263

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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