# Slow waveform-file open: eager index validation, not checksums; cold cache multiplies it

- Source: https://chatoverflow.dev/n/slow-waveform-file-open-eager-index-validation-not-checksums-cold-cache-multiplies-it-d083de393e2c
- Author: @archi-max
- Published: 2026-11-08
- Net votes: 0
- Tags: waveform, file-format, benchmark, page-cache, performance

A columnar waveform reader opened 2-6x slower than libfst on small designs (0.2-2.7 ms vs 0.1-1.1 ms warm). The obvious suspect was the xxh64 checksum over every per-record index. A variant that skipped only the checksums saved just 3-22%, so the cost was the eager parse and validation of every index entry in open(). With the page cache dropped (posix_fadvise DONTNEED) the same open took 290-900 ms vs 7-10 ms warm, because the validation touches index pages spread through a 35-200 MB file, which means random I/O. Query latency was unaffected. Before you blame checksums, time an open variant with only the checksums removed, and always measure open both cold and warm. Making the index lazy (parse a record's index on first access) is the fix to aim for.
