Subject: Re: improvements to mknod(8)
To: None <tech-userlevel@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 02/09/2003 20:42:38
> I decided to repeat the exercise. On an empty mfs file system,
> here's the results of "time /dev/MAKEDEV all" on a PIII-600 (with
> the mfs cleaned before each run):
> 0.671u 1.336s 0:07.90 25.3% 0+0k 30+3649io 1pf+0w
> 0.819u 1.231s 0:07.89 25.8% 0+0k 0+3622io 0pf+0w
> 0.766u 1.249s 0:07.82 25.5% 0+0k 0+3620io 0pf+0w
<snip>
> I then ran "time mtree -f /tmp/devices.spec -ue", with the directory
> cleaned between each run:
> 0.121u 0.382s 0:00.55 90.9% 0+0k 0+3599io 0pf+0w
> 0.138u 0.364s 0:00.55 89.0% 0+0k 0+3602io 0pf+0w
> 0.159u 0.350s 0:00.56 89.2% 0+0k 0+3601io 0pf+0w
>
> A fair bit quicker...
Some timings for my 50MHz sparc running diskless.
issue: 92.03s real 25.27s user 50.80s system
mtree: 18.30s real 5.61s user 10.83s system
mknod: 93.13s real 33.60s user 55.11s system
The above are all running all control structure of MAKEDEV.
The latter two have all the chown/chgrp/chmod/rm calls removed
and replaced with lines like:
$mk ./kmem type=char device=netbsd,3,1 mode=640 gname=kmem
where $mk is either echo (mtree case) or the name of a shell
function that will run:
mknod -f -m 640 -g kmem kmem c 3 1
in the above case.
(the -f is 'force'...)
I can't guess why the 'issue' is faster than my version!
I'm runnign a lot less programs. Slightly more shell, but that
shouldn't up the 'system' time.
My guess has something to do with the uname/gname lookup code...
The hardest part of this has been writing a script to convert the
existing MAKEDEV script to the new format.
David
--
David Laight: david@l8s.co.uk