Commit Graph
6 Commits
Author SHA1 Message Date
Austin Horstman fe03dfaa3b perf(memory): eliminate deep copies in range-based for loops and lambdas
This commit addresses memory churn caused by implicit deep copies during traversal and allocation of complex structures:

- Replaced pass-by-value 'Json::Value' in std::ranges and range-based for loops with 'const auto&' or 'const Json::Value&' in Hyprland modules, preventing large JSON tree duplications on every update.

- Fixed implicit string and pair copies in UPower and CPU Frequency loops by converting 'auto' to 'const auto&' where possible.

- Added 'std::vector::reserve' calls before 'push_back' loops in MPRIS, Niri, and CFFI modules to prevent exponential vector reallocation during initialization.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
Alex ef3d55980e fix: some crashes 2026-02-24 00:49:08 +01:00
Adam Harvey 906170400e cffi: always return config values as JSON
Previously, string JSON values were special cased to be provided as
bare strings, which means that CFFI modules have to either know what
type each value is expected to be, or use a heuristic such as trying to
decode and then treating the value as a string on failure.

Instead, we can always return JSON, and let the downstream consumer
handle deserialising the value into whatever type is expected.

The new behaviour is gated on a new ABI version 2: modules built against
version 1 will continue to get the old behaviour.
2025-03-05 17:11:26 -08:00
Crom (Thibaut CHARLES) 02c64f3f1e Moved all waybar info into a single struct 2023-10-24 20:16:50 +02:00
Crom (Thibaut CHARLES) d86059016e Send update dispatcher though FFI 2023-10-24 20:16:50 +02:00
Crom (Thibaut CHARLES) 088ca6b963 Added cffi/* module for third-party advanced modules 2023-10-24 20:16:50 +02:00