cmp(1) has a bottleneck, but where?

Marc Olzheim marcolz at
Tue Jan 3 08:46:59 UTC 2012

On Tue, Jan 03, 2012 at 12:21:10AM -0800, Garrett Cooper wrote:
>     The file is 3.0GB in size. Look at all those page faults though!
> Thanks!
> -Garrett

From usr.bin/cmp/c_regular.c:

#define MMAP_CHUNK (8*1024*1024)
for (..) {
	mmap() chunk of size MMAP_CHUNK.

That 8 MB chunk size sounds like a bad plan to me. I can imagine
something needed to be done to compare files larger than X GB on a 32bit
system, but 8MB is pretty small...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url :

More information about the freebsd-performance mailing list