diff is really slow if it hits binary files due to its small chunk size. ; time diff /bin/gs /bin/gs 0.005u 0.055s 1.800r diff /bin/gs /bin/gs and with a 32k buffer: time 6.out /bin/gs /bin/gs 0.001u 0.012s 0.485r 6.out /bin/gs /bin/gs Reference: /n/atom/patch/applied/bindiffspeed Date: Mon Sep 28 05:54:34 CES 2015 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/diff/diffreg.c Mon Sep 28 05:53:04 2015 +++ /sys/src/cmd/diff/diffreg.c Mon Sep 28 05:53:05 2015 @@ -316,7 +316,7 @@ flushchanges(); } -#define BUF 4096 +#define BUF 32768 static int cmp(Biobuf* b1, Biobuf* b2) {