[Bitstream] Only consider flushing to file on block boundaries
The goal of flushing to disk is to keep a reasonable bound on peak memory usage. With a a default threshold of 512MB (and most BitstreamWriters having no backing file at all), checking after every byte whether to flush seems excessive. This change makes clangd's unittests run 5% faster (in opt), so it's not actually free even in the case with no backing file. Likely there are more important workloads where it makes some difference. Differential Revision: https://reviews.llvm.org/D125145
Loading
Please sign in to comment