Benchmarking file copying operations

The size of the buffer you use in file operations is really important and affects the performance of your system tools, especially when you are dealing with very big files.

Although developing reliable software should be your main concern, you should not forget to make your systems software fast and efficient!

So, this section will try to see how the size of the buffer affects the file copying operations by executing cp.go with various buffer sizes and comparing its performance with readAll.go, notGoodCP.go as well as cp(1).

In the old Unix days when the amount of RAM on Unix machines was too small, using a large buffer was not recommended. However, nowadays, using a buffer with a size of 100 MB is not ...

Get Go Systems Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.