Test environment: Ubuntu 22.04, 16 GB RAM, NVMe SSD, 50,000 media files (total 200 GB)
| Operation | Cold Cache | Warm Cache | | :--- | :--- | :--- | | Initial scan (full) | 12.4 sec | 0.8 sec | | Query by type (image) | 2.1 sec | 0.05 sec | | Metadata read (single file) | 0.8 ms | 0.2 ms | | Thumbnail generation (128x128) | 15 ms | 8 ms | | Memory footprint (idle) | 8 MB | 12 MB (with cache) | libmediaprovider-1.0
| Operation | libmediaprovider-1.0 | Raw OS APIs |
|-----------|----------------------|--------------|
| Enumerate 5000 local images (cold cache) | 1.2 sec | 0.8 sec |
| Extract metadata from 1000 MP3s | 2.4 sec | 1.9 sec (parallel ffprobe) |
| First scan of network folder (SMB, 2000 files) | 8.1 sec | 6.5 sec |
| Incremental change detection (100 new files) | 0.09 sec | 0.05 sec | Test environment: Ubuntu 22
Test hardware: NVMe SSD, Ryzen 5, Linux 6.1. By moving the heavy-lifting to libmediaprovider-1
Before Android 10, all media scanning and thumbnail generation occurred entirely in the Java layer. This led to significant memory overhead, slower batch operations, and frequent "Application Not Responding" (ANR) errors when scanning large galleries. By moving the heavy-lifting to libmediaprovider-1.0, Google achieved: