14 Commits

Author SHA1 Message Date
790101f824 chore: format
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-06 18:49:02 -06:00
b31292dee2 Merge pull request #4898 from khaneliman/memory
perf(memory): optimize string operations; remove deep copies, memdup, and icon theme rescanning
2026-03-04 22:40:55 +01:00
4c71b2bf9f perf(memory): optimize C++ string operations to reduce heap fragmentation
- Replaced pass-by-value std::string parameters with const std::string&
or std::string_view to prevent SSO overallocations.

- Refactored static mapping functions in UPower to return
std::string_view instead of constructing std::string literals, enabling
perfect cache locality.

- Optimized string concatenation in hot loops (network IPs, inhibitor
lists, sway window marks) by using std::string::append() and
pre-reserving capacity instead of overloaded operator+ which produces
temporary heap instances.

These optimizations reduce high-frequency memory churn and overall heap
fragmentation within the main rendering loops.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
79fb1d9f58 test(command): cover exec failure paths
Command tests did not assert behavior when exec fails in child processes.

I added deterministic regression coverage that forces execl/execlp failure and
verifies non-zero exit status propagation for both open() and forkExec paths.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:44:54 -06:00
fd086d0f33 Merge pull request #4890 from khaneliman/bugfix/perf-001-safe-signal-bounded-queue
fix(util): bound SafeSignal queue growth under burst load
2026-03-01 18:19:25 +01:00
e4ff024fa8 fix(util): bound SafeSignal queue growth under burst load
SafeSignal could queue events forever when worker threads emitted faster than
the main loop could consume, which risks memory growth and stale updates.

I added a queue cap with a drop-oldest policy so growth stays bounded under
burst load, plus a regression test that validates bounded delivery.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-28 22:57:49 -06:00
864523772d test(utils): stress SleeperThread wake and stop control flow
SleeperThread concurrency paths needed stress coverage around wake/stop races.

I added a subprocess stress test that repeatedly interleaves wake_up() and
stop() and verifies the worker exits cleanly.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-28 22:47:52 -06:00
1c61ecf864 test(utils): add SleeperThread reassignment regression
We needed a regression test for reassignment safety after lifecycle fixes.

I added a subprocess test that reassigns SleeperThread workers and verifies the
process exits normally instead of terminating.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-28 22:47:52 -06:00
47fb21a2c1 chore: upgrade to clang-format@21 2026-02-04 09:24:14 +01:00
e4dd2ecc5a refactor: avoid namespace pollution in util/date.hpp 2025-06-22 00:50:25 -04:00
6417782af6 chore: lint 2024-09-13 08:55:14 +02:00
b114b1155c treewide: clang-format 2024-06-15 18:44:46 -05:00
0bc43c1aa7 fix: lint 2024-06-12 23:08:27 +02:00
58e7abba2c tests: split into separate binaries 2024-06-08 22:43:48 -05:00