Avoid using microtime(9) for atime/mtime, we don't need to have it
THAT accurate and microtime(9) is painlessly slow on i386 currently. This speeds up small transfers much. The gain for large transfers is less significant, but notable too. Bottleneck was found by Andreas Persson (Re: kern/14246). Performance improvement with PIII on 661 Mhz according to hbench (with PIPE_MINDIRECT=8192): buffersize before after 512 17 49 1024 33 110 2048 52 143 4096 77 163 8192 142 190 64K 577 662 128K 372 392
This commit is contained in:
parent
47ea6cbd85
commit
24ba90929c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sys_pipe.c,v 1.16 2001/10/08 07:50:17 mycroft Exp $ */
|
||||
/* $NetBSD: sys_pipe.c,v 1.17 2001/10/28 20:47:15 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 John S. Dyson
|
||||
|
@ -82,12 +82,18 @@
|
|||
#include <sys/syscallargs.h>
|
||||
#include <uvm/uvm.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/kernel.h>
|
||||
#endif /* NetBSD, FreeBSD */
|
||||
|
||||
#include <sys/pipe.h>
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#define vfs_timestamp(tv) microtime(tv)
|
||||
/*
|
||||
* Avoid microtime(9), it's slow. We don't guard the read from time(9)
|
||||
* with splclock(9) since we don't actually need to be THAT sure the access
|
||||
* is atomic.
|
||||
*/
|
||||
#define vfs_timestamp(tv) (*(tv) = time)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue