vars1ty / HybridBar

A status bar focused on wlroots Wayland compositors
MIT License
196 stars 10 forks source link

[TODO] Rework `config::try_get` #13

Closed vars1ty closed 2 years ago

vars1ty commented 2 years ago

Rework config::try_get because as of right now, it's parsing the config for every single call made to it, leading to wasted performance and larger overhead.

vars1ty commented 2 years ago

Related to https://github.com/vars1ty/HybridBar/pull/12#issuecomment-1296358355

vars1ty commented 2 years ago
if let Some(c_variable) = config::try_get("hybrid", "something", true, false) { }

Added in ebdeeb7b7573bbd035445cb839f5723b5b26c681

vars1ty commented 2 years ago

f8a86f6198ef06b6ed3278a753bd79e0315adfd5 also removes the need for re-parsing the config every single time.

Rough timings until fully started: Before: 330ms+/- Now: 120ms+/-