freebsd-dev/usr.bin/ar
Ed Maste 01715d8cd1 speed up ar(1) on UFS file systems
Fault in the buffer prior to writing to workaround poor performance due
to interaction with kernel fs deadlock avoidance code. See the comment
prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the
issue.

On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see
the following run times (seconds):

x ar.r284891
+ ar.patched
+----------------------------------------------------------------------+
|+                                                                     |
|+                                                                    x|
|+                                                                   xx|
|A                                                                   |A|
+----------------------------------------------------------------------+
    N         Min          Max        Median           Avg        Stddev
x   3       1.307        1.321         1.315     1.3143333  0.0070237692
+   3       0.020        0.023         0.022   0.021666667  0.0015275252
Difference at 95.0% confidence
        -1.29267 +/- 0.0115203
        -98.3515% +/- 0.876513%
        (Student's t, pooled s = 0.00508265)

Thanks to kib for diagnosing and explaining the issue and suggesting
the workaround.

Reviewed by:	eadler, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2933
2015-06-29 13:48:44 +00:00
..
acplex.l Work around build breakages with GCC 4.2. 2013-05-23 05:42:35 +00:00
acpyacc.y Replace deprecated (or remove obsolete) libarchive 2.8 functions 2013-03-22 10:17:42 +00:00
ar.1 use .Mt to mark up email addresses consistently (part3) 2014-06-23 08:23:05 +00:00
ar.c
ar.h
Makefile Convert to usr.bin/ to LIBADD 2014-11-25 14:29:10 +00:00
Makefile.depend new depends 2015-06-16 23:37:19 +00:00
read.c Avoid escaping EOL for line continuation 2015-04-09 15:08:39 +00:00
util.c
write.c speed up ar(1) on UFS file systems 2015-06-29 13:48:44 +00:00