Re: [PATCH]: fdalloc optimization

From: Divacky Roman <xdivac02_at_stud.fit.vutbr.cz>
Date: Mon, 22 Aug 2005 10:33:20 +0200
On Mon, Aug 22, 2005 at 10:49:32AM +0300, Giorgos Keramidas wrote:
> On 2005-08-22 09:40, Divacky Roman <xdivac02_at_stud.fit.vutbr.cz> wrote:
> >On Sun, Aug 21, 2005 at 01:54:06PM -0400, Kris Kennaway wrote:
> >>On Sun, Aug 21, 2005 at 10:45:46AM +0200, Divacky Roman wrote:
> >>> I made a patch for fdalloc which could speed it up a bit, its stored under
> >>> kern/85176 or http://hysteria.sk/~neologism/kern_descrip.patch
> >>
> >> That's all nice and everything, but *does* it speed it up a bit? :-)
> >
> > ie. its never slower but I think this is insignificant. on the other hand -
> > buildkernel is not that fdalloc sensitive. dont know how to measure it ;(
> 
> 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);

tested by:

#!/bin/csh

set i=100;

while ($i > 0)
      _at_ i--
      rtprio 10 ./a.out
end

and ministat showed:

x /tmp/old_kernel
+ /tmp/new_kernel
+--------------------------------------------------------------------------+
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +                                                               |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          +x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                              |
|          *x                                                             x|
|          *x                                                             x|
|          *x                                                             *|
|          *x                                                             *|
|          *x                                                             *|
|||________MMA_A________|___|                                              |
+--------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x 100         39957        959570         41444      87169.69     201011.84
+ 100         37786        962107         38766      66353.09     158258.74
No difference proven at 95.0% confidence


anyway - commenting out duplicate code MUST speed it up, maybe insignificantly
but still ;)

roman
Received on Mon Aug 22 2005 - 06:33:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:41 UTC