Repository navigation
Increase buffer size for IO operations. - #80
mkolomeytsev wants to merge 1 commit into
Conversation
| #define str_startswith(s, p) (strncmp((s), (p), strlen((p))) == 0) | ||
|
|
||
| /* buffer size for IO operations */ | ||
| #define READ_BUF_SZ (1<<18) |
There was a problem hiding this comment.
Maybe use different constants, for hash (old 16K) and copy (old 10K) ?
And maybe also configurable, for different systems / target platforms...
|
@itensionanders: You mentioned some experiments you made in https://lists.samba.org/archive/ccache/2016q2/001431.html. What's your stance on this pull request? Do you think that we should just increase the buffer size to e.g. 256 KiB as suggested by @mkolomeytsev? Or just increase to16 KiB in copy_fd and copy_file? Or do something more fancy? |
|
Some benchmark would be nice ? I don't have any figures ready, sorry. But 256K "sounds" big ? |
Yes, it sounds big to me too. I'm surprised that it makes such difference for Michael on OSX.
Yep, that's uncontroversial. I've now done some benchmarks myself now. On my 64-bit Linux system, I see no performance difference when going from 10 KiB to 16 KiB. However, going from 16 KiB to 32 KiB gives a significant performance increase (≈ 10%). Buffer sizes between 64 KiB and 2 MiB perform the same as 32 KiB for me. 4 MiB is worse again. I think we can conclude that different systems behave differently, but going for multiple of 4 KiB and at least 32 KiB sounds good. Related: By using I'll apply this PR but change the size to 64 KiB for now. I'll also look into refactoring the copy_*/hash_fd functions in spirit of #81. |
https://lists.samba.org/archive/ccache/2016q2/001429.html