FYI patch: using write to output the file

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 15:35:16 PST 2016


On 8 March 2016 at 18:24, Rui Ueyama <ruiu at google.com> wrote:
> I don't know if it could theoretically make it faster. I think that if your
> write to a mmap'ed buffer actually have to hit a disk, that access blocks
> the thread, but as we only write to a mmap'ed area, so it virtually never
> blocks for our case, no?

My understanding is that a write just copies the data to kernel space
and the program continues.

mmap will cause a page fault which has to stop the program.

There is an old thread "Benchmarking file output strategies" with a
synthetic program. At some point I should run it on perf to see where
the kernel is spending time or waiting for hardware.

Cheers,
Rafael


More information about the llvm-commits mailing list