[all-commits] [llvm/llvm-project] d44ffd: [Bitstream] Only consider flushing to file on bloc...

Sam McCall via All-commits all-commits at lists.llvm.org
Sat May 7 07:57:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d44ffd631cd04dfed3bced8c34e7aadf59e471dc
      https://github.com/llvm/llvm-project/commit/d44ffd631cd04dfed3bced8c34e7aadf59e471dc
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-05-07 (Sat, 07 May 2022)

  Changed paths:
    M llvm/include/llvm/Bitstream/BitstreamWriter.h

  Log Message:
  -----------
  [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




More information about the All-commits mailing list