[PATCH]: fdalloc optimization

Robert Watson rwatson at FreeBSD.org
Mon Aug 22 12:48:31 GMT 2005

On Mon, 22 Aug 2005, Divacky Roman wrote:

>> By running an application that opens (and keeps open) many files, i.e. 
>> a program that creates many temporary files, keeps them open and then 
>> closes them all at once before exiting?
> I did:
> gettimeofday(&t1, NULL);
>   for (; i>0; i--) {
>            if (open("/dev/null", O_RDONLY) == -1) {
> 		perror(NULL);
> 		break;
> 	    }
>  }
> gettimeofday(&t2, NULL);

src/tools/tools/syscall_timing provides a number of simple 
micro-benchmarks of common system calls, including several that allocate 
file descriptors (such as pipe creation, socket allocation, etc).  Run 
about ten sets each of {before,after}, drop the first entry for each 
("warmup"), and then use ministat to compare the results on a couple of 
key system calls?

Robert N M Watson

More information about the freebsd-current mailing list