Benchmarking file output strategies

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Dec 16 06:17:39 PST 2014


On 15 December 2014 at 22:20, Sean Silva <chisophugis at gmail.com> wrote:
> Michael and I just did some experiments on his machine. It looks like
> Windows is doing a huge amount of IO *after* the program exits (both mmap
> and write). Which reminds me: in your OP, the windows 7 vm mmap version
> (1.6s) is faster than the native Mac HFS+ version; those were on the same
> machine, right? If so, then it is weird that the vm was outperforming the
> native OS, so something like this IO-after-program-exit is probably at work.

Yes, the VM was on the OS X machine.

> We did find on Michael's machine (Win 8) that the mmap version was generally
> slower, roughly similar to what I was seeing on my Mac (although on the Mac
> the data was being committed to disk before the program exited).

Interesting.

We don't sync, which I assume is intentional. We want make sure any
other process in the build will see the complete result, but it is OK
to have to clear a build dir in a power loss.

I wonder if the difference in IO performance with rand is just because
the kernel has more time to actually write stuff to disk. Windows
could also just be more aggressive about delaying the writes.

Can you give the attached version a try? It includes a call to fsync
and a version that uses WriteFile (not sure what is needed to sync
that).

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-file-output.cpp
Type: text/x-c++src
Size: 3045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141216/be5696ff/attachment.cpp>


More information about the llvm-commits mailing list