Skip to content

Batch IFD and value reads - #6

Merged
mgenware merged 2 commits into
mgenware:mainfrom
neeraj-pilot:batch-exif-reads
Aug 29, 2026
Merged

Batch IFD and value reads#6
mgenware merged 2 commits into
mgenware:mainfrom
neeraj-pilot:batch-exif-reads

Conversation

@neeraj-pilot

@neeraj-pilot neeraj-pilot commented Aug 29, 2026

Copy link
Copy Markdown

Batches contiguous IFD entries and numeric values into bounded reads, reducing async RandomAccessSource round trips without changing the API.

Across all eight bundled fixtures, the sum of median warm-cache macOS AOT parse times fell from 100.86 ms to 15.82 ms, while source read calls fell from 4,974 to 606, with exact tag and warning parity.

Fixture Baseline Batched Speedup Read calls
AVIF 7.14 ms 2.35 ms 3.0× 381 → 131
HEIC 61.97 ms 3.98 ms 15.6× 3,230 → 214
JXL 1.00 ms 0.64 ms 1.6× 43 → 24
JXL/Brotli 1.66 ms 1.55 ms 1.1× 12 → 12
PNG 2.00 ms 0.59 ms 3.4× 103 → 28
CR3 2.00 ms 1.03 ms 1.9× 19 → 19
RAF 18.75 ms 4.14 ms 4.5× 862 → 104
WebP 6.33 ms 1.55 ms 4.1× 324 → 74

The cumulative effect is:

Configuration Summed median Logical reads Physical reads
Original direct source 100.86 ms 4,974 4,974
4 KiB read-ahead 8.71 ms 4,974 19
Read-ahead + this PR 5.25 ms 606 19

Together, read-ahead and batching make the original path 19.2× faster and reduce physical reads from 4,974 to 19. This PR provides a further 1.7× improvement on the read-ahead path.

@mgenware
mgenware merged commit c6f94aa into mgenware:main Aug 29, 2026
@mgenware

Copy link
Copy Markdown
Owner

Published v4.2.0

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.

3 participants