Slow wallet loading
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
- 領域
- performance
調査の方向性
Cache::hash から開始し、issue に記載されている profiler データと 4,607 個の更新ファイルを使って、legacy FS ストアの読み込み中にその呼び出しを追跡します。286,064 個のタイムスタンプを含むキャッシュで低速化を再現し、その後、wallet-status の検証を削除せずに wallet の読み込みが大幅に高速化されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
I'm running a testnet LWK wallet with the legacy FS store.
There are 2075 transactions in total and 4607 update files in the enc_cache folder.
Recently I noticed that the wallet loading became quite slow.
It now takes about 29 seconds to load the wallet in the release build.
I attached a profiler and saw that the bottleneck is in this line:
let mut vec: Vec<_> = self.timestamps.iter().collect();
vec.sort(); // This line takes most of the time, 29 seconds in my case
vec.hash(state);
After I changed it to this (to prevent extra indirection):
let mut vec: Vec<(u32, u32)> = self.timestamps.clone().into_iter().collect();
It took about 18 seconds to load the wallet.
And after I commented out this code:
if self.wollet_status() != update.wollet_status {
return Err(Error::UpdateOnDifferentStatus {
wollet_status: self.wollet_status(),
update_status: update.wollet_status,
});
}
It took less than 2 seconds to load the wallet.
Here is my cache size at the end:
all_txs size: 2075
scripts size: 2118
heights size: 2118
unblinded size: 2118
timestamps size: 286064
Cache::hash is called 4607 times (once per an update file).
So in my case, LWK is sorting up to 286064 elements 4607 times on loading.
I think this should be fixed.
- 主要言語
- Rust
- スター
- 113
- フォーク
- 64
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Blockstream/lwk のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Blockstream/lwk#194 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
Blockstream/lwk#193 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
Blockstream/lwk#192 ·
-
難易度 3/5 半日 初心者へのやさしさ 35/100
Blockstream/lwk#189 · コメント 1 件 ·
-
lwk_wasm: no way to read TxOutSecrets for a PSET output blinded by the wallet対応中かも @LeoComandini が 54 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Blockstream/lwk#177 · 担当者 1 名 ·
Blockstream/lwk の issue をすべて見る
似ている issue
-
area: cli kind:docs priority: P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
swc-project/swc-ai-issues#164 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pop-os/cosmic-player#367 ·
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
servo/rust-smallvec#873 ·