get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?)

Warren Young warren@etr-usa.com
Sat Feb 8 15:39:00 GMT 2014


On Feb 8, 2014, at 8:19 AM, Warren Young <warren@etr-usa.com> wrote:

> On Feb 7, 2014, at 5:40 PM, Andrey Repin <anrdaemon@yandex.ru> wrote:
> 
>> 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).

A clarification:

I agree that /etc/passwd is being cached for the entire test.  My 12-line file is a bit over 1K, so it fits easily into a 4K RAM page.  Also, I repeated my tests several times, so even the initial disk read is cached.

The fact that we see a 6x speed difference depending on where in the file — or RAM page, if you prefer — the target record is tells us that lookups are dominated by parsing time.

Parsing overhead shouldn’t exist for SAM or AD. They’re “pre-parsed.”

The equivalent overhead in SAM/AD terms is tree and index traversal, which should happen a lot faster than O(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



More information about the Cygwin mailing list