Benchmarking file output strategies

Yaron Keren yaron.keren at gmail.com
Sat Dec 13 02:17:42 PST 2014


With Windows 7 64 bit, 7200 rpm Hard Disk:

3.813218e+00
2.341834e+01

mmap is consistently 5-6 times faster.

With Windows 7 64 bit, SSD there is less of a difference,

3.447606e+00
4.711208e+00

the SSD timing results were inconsistent, most of the time mmap is faster
but I also saw the inverse

3.456198e+00
2.989171e+00


2014-12-13 1:30 GMT+02:00 Rafael Ávila de Espíndola <
rafael.espindola at gmail.com>:

> It seems that the common wisdom on the fastest way to create a file is
>
> * create the file
> * resize it to the final size
> * mmap it rw
> * write the data to the mapping
>
> I benchmarked that against doing 1 MB writes to create a 1GB file with
> pseudo random data.
>
> The test program is attached. The results I got were (in seconds, mmap is
> the first):
>
> btrfs
> 1.752698e+00
> 1.112864e+00
>
> tmpsfs
> 1.484731e+00
> 1.113772e+00
>
> hfs+ (laptop)
> 4.015817e+00
> 2.240137e+00
>
> windows 7 (vm)
> 1.609375e+00
> 3.875000e+00
>
> ext2 on arm (old google chrome book):
> 5.910171e+01
> 6.566929e+01
>
> So on Windows it is true, mmap seems to be faster than writes. On Linux
> and OS X x86_64 the situation is inverted. On arm mmap is a bit faster.
>
> It would be interesting to see if someone else can reproduce these
> numbers. It would be particularly nice to try a newer arm system and
> windows outside a vm.
>
> Also, does anyone have a theory of where the difference comes from?
>
> Cheers,
> Rafael
>
>
>
>
> Sent from my iPhone
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141213/5d87f4f6/attachment.html>


More information about the llvm-commits mailing list