perf(#270): artwork base64 が未変化ならデコード済み Data を再利用#274
Conversation
media-remote-helper はイベント毎にフルペイロードを再送するため、同一 トラックの elapsed 更新でも高解像度アートワークのフルデコードが毎回 走っていた。直前の base64 文字列と比較し、一致時はデコード済み Data を 返すメモ化を StreamStateBox(lock 保護)に追加。デコード関数は init 注入 にしてテストで呼び出し回数を検証できるようにした。
|
Warning Review limit reached
More reviews will be available in 47 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Closes #270 (Part of #258)
概要
media-remote-helperはイベント毎にフルペイロードを再送するため、同一トラックの elapsed 更新でも高解像度アートワークの base64 フルデコードが毎回走っていた。直前のイベントの base64 文字列と比較し、一致時はデコード済みDataを再利用するメモ化を入れて、変化時のみデコードするようにした。変更内容
MediaRemoteDataSourceImpl.artworkData(from:)を追加 —StreamStateBoxにlastArtworkBase64/lastArtworkDataを持たせ、lock 保護下で比較・キャッシュするdecodeBase64を init 注入に変更(public convenience init()は従来どおりData(base64Encoded:)を使用)— テストでデコード呼び出し回数を検証可能にするためDataを返す補足
Dataアロケーション + base64 デコード本体に比べ十分軽量テスト
swift test全 928 件パスmake format適用済み