|
Re: [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.c: msg#00074security.nmap.devel
Dmitry V. Levin wrote: > On Fri, Dec 15, 2006 at 11:43:38AM -0600, Kris Katterjohn wrote: >> This simple patch dramatically reduces the number of fopen()s and >> fclose()s used when getting random numbers from nbase_rnd.c by keeping >> the rng device open. >> >> Before: >> >> # strace nmap -p- localhost 2>&1 | grep 'open("/dev/[au]*random"' | wc >> 512 3584 31744 >> >> After: >> >> # strace ./nmap -p- localhost 2>&1 | grep 'open("/dev/[au]*random"' | wc >> 2 14 124 > > You can also compare "strace -c" output to estimate effect of the change. > Oh cool, thanks. The only problem with trying to compare the difference like this is that fopen() has more "stuff" in it than an open() call. If it's just like the one in K&R (Ch. 8 or 9, I believe), it might not be a big deal, but with what's probably in glibc, for example, it's likely bloated -- or at least "feature-rich" :) Of course I _am_ the one who initially counted the open()s, but I just wanted to see how many times fopen() is called, along with the extra stuff in it. Thanks, Kris Katterjohn _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.c: 00074, Dmitry V. Levin |
|---|---|
| Next by Date: | [PATCH] Test for getopt_long_only() return value -1: 00074, Kris Katterjohn |
| Previous by Thread: | Re: [PATCH] Dramatically reduce # of fopen()s and fclose()s in nbase_rnd.ci: 00074, Dmitry V. Levin |
| Next by Thread: | [PATCH] Test for getopt_long_only() return value -1: 00074, Kris Katterjohn |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |