> But having to look for various OS/kernel versions of sendfile()? Eww. > Might as well stick with "splice()", since other main systems like > have solutions already: Win32 have CopyFile and OS X has copyfile. > And doing some "advise/allocate" sounded easy, but had pitfalls too. > > Here is the end result, in case anyone is interested in a preview: > https://github.com/jrosdahl/ccache/compare/master...itensionanders:uncompressed > > It sounded like a good idea, but needs some actual benchmarks to see > whether it was actually worth it. Probably should check st_blksize too.
Turns out the OS X version needed another header (<copyfile.h>) to work, and that it was mostly about HFS metadata. Actually *slower*, for files! So removed the system versions from the code, only kept the splice(). The fadvise/fallocate only seems to exist on Linux, OS X uses fcntl ? > The actual I/O can probably be made twice as fast (e.g. for a 1M file) > Question is whether it makes any real impact of the ccache run time ? Too much hassle, it seems ? The Linux version might be worth keeping, but for the rest it seems that the KISS principle applies (as always) /Anders _______________________________________________ ccache mailing list email@example.com https://lists.samba.org/mailman/listinfo/ccache