This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?)
- From: Warren Young <warren at etr-usa dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 8 Feb 2014 08:19:09 -0700
- Subject: Re: get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?)
- Authentication-results: sourceware.org; auth=none
- References: <52F339CA dot 5070305 at gmail dot com> <20140206090117 dot GD2821 at calimero dot vinschen dot de> <52F361C5 dot 3000807 at gmail dot com> <20140206141321 dot GI2821 at calimero dot vinschen dot de> <52F40208 dot 5030901 at etr-usa dot com> <20140207094917 dot GN2821 at calimero dot vinschen dot de> <52F53D7C dot 5050201 at etr-usa dot com> <52F553AA dot 9090500 at cygwin dot com> <52F561EE dot 8090806 at tiscali dot co dot uk> <52F56E92 dot 3070309 at cygwin dot com> <675717060 dot 20140208044040 at mtu-net dot ru>
On Feb 7, 2014, at 5:40 PM, Andrey Repin <anrdaemon@yandex.ru> wrote:
>>> I thought the point of the programme /was/ to call getpwnam() a million
>>> times.
Precisely.
> In either case, repeatedly requesting the same record in a short amount of
> time will only test the system level cache.
If that were true, moving the requested record around in /etc/passwd wouldn’t cause a 6x spread in test results. That’s O(N) type behavior, whereas a cache approaches O(1).
If SAM uses a tree-structured DB, as I suspect, it will be some logarithmic function, like O(log2(N)).
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple