[PR #20] [MERGED] Improve data locking performance #582

Closed
opened 2026-03-02 23:48:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/20
Author: @aome510
Created: 10/26/2021
Status: Merged
Merged: 10/26/2021
Merged by: @aome510

Base: masterHead: improve-data-performance


📝 Commits (10+)

  • f2a374a add parking_lot and crossbeam_channel
  • 63f2d04 use parking_lot::{Mutex,RwLock} instead of the std::sync alternatives
  • cb5de77 remove state::UIStateGuard as a function parameter in event module
  • c30028a reduce the uses of UIStateGuard as function parameter in ui module
  • a8cb471 drop the mutex lock to avoid deadlock
  • 1dc941e fix the wrong render position of the shortcut help popup
  • 0cc3785 remove the use of UIStateGuard as a function parameter
  • 42560c2 cleanup p1
  • 2a36408 fix deadlock in popup event main handling function
  • 46eab74 fix error not handling search page event correctly

📊 Changes

17 files changed (+561 additions, -610 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 doc/config.md (+1 -1)
📝 spotify_player/Cargo.toml (+1 -0)
📝 spotify_player/src/client/handlers.rs (+5 -7)
📝 spotify_player/src/client/mod.rs (+40 -56)
📝 spotify_player/src/event/mod.rs (+43 -36)
📝 spotify_player/src/event/popup.rs (+97 -107)
📝 spotify_player/src/event/window.rs (+105 -85)
📝 spotify_player/src/state/mod.rs (+33 -17)
📝 spotify_player/src/state/model.rs (+8 -9)
📝 spotify_player/src/state/ui.rs (+32 -61)
📝 spotify_player/src/ui/context.rs (+27 -44)
📝 spotify_player/src/ui/help.rs (+44 -57)
📝 spotify_player/src/ui/mod.rs (+65 -72)
📝 spotify_player/src/ui/popup.rs (+39 -32)
📝 spotify_player/src/ui/search.rs (+15 -19)
📝 spotify_player/src/utils.rs (+5 -7)

📄 Description

Brief description of changes

  • add parking_lot library to replace std::sync::{RwLock, Mutex}
  • remove the uses of specifying locking guards as a function parameter

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/spotify-player/pull/20 **Author:** [@aome510](https://github.com/aome510) **Created:** 10/26/2021 **Status:** ✅ Merged **Merged:** 10/26/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `improve-data-performance` --- ### 📝 Commits (10+) - [`f2a374a`](https://github.com/aome510/spotify-player/commit/f2a374ac6dce931630ad3d843a100bf23f4954f1) add `parking_lot` and `crossbeam_channel` - [`63f2d04`](https://github.com/aome510/spotify-player/commit/63f2d042018f9b5c01f9e6be27dbc0ba65860882) use `parking_lot::{Mutex,RwLock}` instead of the `std::sync` alternatives - [`cb5de77`](https://github.com/aome510/spotify-player/commit/cb5de77bd0df7c8d471a089d79a2b43d402a40b3) remove `state::UIStateGuard` as a function parameter in `event` module - [`c30028a`](https://github.com/aome510/spotify-player/commit/c30028a0bf02b002225b1622d3d1c9d7894383f9) reduce the uses of `UIStateGuard` as function parameter in `ui` module - [`a8cb471`](https://github.com/aome510/spotify-player/commit/a8cb4714227ab8fff97d1828ae9ac69aa088f777) drop the mutex lock to avoid deadlock - [`1dc941e`](https://github.com/aome510/spotify-player/commit/1dc941e0d19f114b2d7c141349f5d1cd7818c53d) fix the wrong render position of the shortcut help popup - [`0cc3785`](https://github.com/aome510/spotify-player/commit/0cc3785c36560dc9f462d7c3948c14917cee6135) remove the use of `UIStateGuard` as a function parameter - [`42560c2`](https://github.com/aome510/spotify-player/commit/42560c27f7bbe105fabc752365be4fe0b7b4a176) cleanup p1 - [`2a36408`](https://github.com/aome510/spotify-player/commit/2a3640888beddb8bb6e7d1a0fec389e5efac3c36) fix deadlock in popup event main handling function - [`46eab74`](https://github.com/aome510/spotify-player/commit/46eab74ed1ae67f03a22adde2e20c373a3e70493) fix error not handling search page event correctly ### 📊 Changes **17 files changed** (+561 additions, -610 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `doc/config.md` (+1 -1) 📝 `spotify_player/Cargo.toml` (+1 -0) 📝 `spotify_player/src/client/handlers.rs` (+5 -7) 📝 `spotify_player/src/client/mod.rs` (+40 -56) 📝 `spotify_player/src/event/mod.rs` (+43 -36) 📝 `spotify_player/src/event/popup.rs` (+97 -107) 📝 `spotify_player/src/event/window.rs` (+105 -85) 📝 `spotify_player/src/state/mod.rs` (+33 -17) 📝 `spotify_player/src/state/model.rs` (+8 -9) 📝 `spotify_player/src/state/ui.rs` (+32 -61) 📝 `spotify_player/src/ui/context.rs` (+27 -44) 📝 `spotify_player/src/ui/help.rs` (+44 -57) 📝 `spotify_player/src/ui/mod.rs` (+65 -72) 📝 `spotify_player/src/ui/popup.rs` (+39 -32) 📝 `spotify_player/src/ui/search.rs` (+15 -19) 📝 `spotify_player/src/utils.rs` (+5 -7) </details> ### 📄 Description ## Brief description of changes - add `parking_lot` library to replace `std::sync::{RwLock, Mutex}` - remove the uses of specifying locking guards as a function parameter --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:48:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#582
No description provided.