Skip to content

Optimize media library collection hot paths - #3

Merged
valib merged 1 commit into
mainfrom
perf/collection-hotpaths
Sep 15, 2026
Merged

valib merged 1 commit into
mainfrom
perf/collection-hotpaths

Conversation

@valib

@valib valib commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • avoid loading media metadata when a resource name already matches
  • preserve filtering semantics while compacting results in linear time
  • use locale-independent case conversion
  • deduplicate media-library file results with a LinkedHashSet
  • clear replaced children once instead of repeatedly removing from an ArrayList
  • remove an unnecessary class-wide lock and reuse the YouTube URL pattern
  • add regression tests for lazy media access, locale handling, and last-match selection

Validation

  • git diff --check passes
  • remote blob SHAs match the locally committed files
  • targeted Maven tests could not run in the execution environment because Maven Central DNS resolution is blocked

Scope

This PR intentionally contains the low-risk collection hot-path improvements. Async thumbnail localization, batched MediaInfo hydration, and shortening the refresh critical section require separate lifecycle/concurrency changes and should be handled independently.

@valib
valib marked this pull request as ready for review September 15, 2026 13:09
@valib
valib merged commit 9fa1c03 into main Sep 15, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant