started rewriting the entire pipeline. main changes:
-
complete
MediaCenter::process_eventrewrite
rewritten completely from scratch. now takes up 40 less lines, skips invalid tracks earlier, and is much simpler to understand -
ticking logic improvement
the app used to tick every 5 s to check track duration, which means 12/min. instead, i now calculate how far the 50% mark is and sleep for only that long; when we’re past it, it’ll just idle until the next track. the app now only wakes once per event, rather than 12 times/min -
use unicase crate to avoid unnecessary allocationsmost of the
Stringallocations i make in the program areto_lowercase()calls for comparisons. the unicase crate allows me to make case-insensitive comparisons without extra allocations.
all of this SHOULD mean less CPU and memory usage (i’m a bit obsessed with that, if you can’t tell yet), but i havent benched anything yet
this PR edits like 500 lines but there’s only like 20 lines more than there were originally lol
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.