Re: cmp(1) has a bottleneck, but where?

Marc Olzheim <[email protected]>
Newsgroups gmane.os.freebsd.performance
Message-ID <[email protected]>
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.
	compare
	munmap()k
}

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...

Marc
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk8Cva4ACgkQezjnobFOgrGrbwCfdhbKDodxrvUN2TZhpPbbUnhE
6vEAoMVxRX6Fn8rtoqDGwZ9Iaz8Sf/kV
=rOJW
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.