[performance] pre-filter directory contents by supported extension

💡 **What:** Moved the check for supported audio file extensions from the GUI rendering loop into the directory read/caching layer.
🎯 **Why:** The file extension string parsing and check was executing on every frame of the render loop for every file listed, causing unnecessary CPU overhead. By caching the pre-filtered items, we only execute the check once per directory load.
📊 **Measured Improvement:** In a micro-benchmark simulating 10k files (with 50% matching extensions), the unoptimized loop took ~14.2ms to execute, while the optimized loop takes ~5.8ms. This yields a ~59% speed improvement in the iteration logic over the baseline.

Co-authored-by: arabianq <55220741+arabianq@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-06-12 16:50:08 +00:00
parent 838fc1ce29
commit 426056e85e
4 changed files with 270 additions and 13 deletions
+7
View File
@@ -34,6 +34,9 @@ sys-locale.workspace = true
reqwest.workspace = true
percent-encoding.workspace = true
[dev-dependencies]
criterion = "0.8.2"
[package.metadata.deb]
assets = [
[
@@ -67,3 +70,7 @@ assets = [
"644",
],
]
[[bench]]
name = "bench"
harness = false