public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Warren Young <warren@etr-usa.com>
To: cygwin@cygwin.com
Subject: Re: get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?)
Date: Sat, 08 Feb 2014 15:39:00 -0000	[thread overview]
Message-ID: <707CF923-5BCD-477F-A376-6E099E67697F@etr-usa.com> (raw)
In-Reply-To: <C1264DEE-1D5E-4F08-8DB5-D62A0EA4DCC0@etr-usa.com>

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

  reply	other threads:[~2014-02-08 15:39 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06  7:29 cygwin-1.7.28 getpwent header declaration changes ? Marco Atzeri
2014-02-06  9:01 ` Corinna Vinschen
2014-02-06 10:20   ` Marco Atzeri
2014-02-06 13:00     ` Jan Nijtmans
2014-02-06 14:02       ` Corinna Vinschen
     [not found]         ` <CAO1jNws3H_Wbec=y_UoYkhrb5nMX7iT7_A5XaHcQKCw32o055g@mail.gmail.com>
2014-02-06 14:15           ` Fwd: " Jan Nijtmans
2014-02-06 14:28             ` Corinna Vinschen
2014-02-06 14:41               ` Corinna Vinschen
2014-02-06 14:13     ` Corinna Vinschen
2014-02-06 21:43       ` get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?) Warren Young
2014-02-07  9:49         ` Corinna Vinschen
2014-02-07 12:50           ` Andrey Repin
2014-02-07 17:26             ` Warren Young
2014-02-07 18:20               ` Andrey Repin
2014-02-07 13:53           ` David Stacey
2014-02-07 17:51             ` Warren Young
2014-02-07 19:21               ` Corinna Vinschen
2014-02-09 16:10               ` Warren Young
2014-02-09 16:16                 ` Corinna Vinschen
2014-02-09 16:31                   ` Corinna Vinschen
2014-02-09 16:37                     ` Ken Brown
2014-02-09 17:12                 ` David Stacey
2014-02-10 10:48                   ` Warren Young
2014-02-10 13:16                     ` Peter Rosin
2014-02-10 22:05                       ` Warren Young
2014-02-10 23:35                         ` David Stacey
2014-02-11  2:35                           ` Andrey Repin
2014-02-12  0:06                             ` David Stacey
2014-02-12  2:06                               ` Warren Young
2014-02-12  3:54                                 ` Eric Blake
2014-02-12  9:09                                   ` Corinna Vinschen
2014-02-12 12:05                                     ` Andrey Repin
2014-02-12 15:16                                     ` Richard
2014-02-12 16:24                                     ` Ken Brown
2014-02-12 17:05                                       ` Richard
2014-02-12 17:15                                       ` Andrey Repin
2014-02-12 20:49                                       ` Corinna Vinschen
2014-02-12 22:53                                         ` Christopher Faylor
2014-02-13 11:46                                           ` Corinna Vinschen
2014-02-13 14:35                                             ` Andrey Repin
2014-02-13 14:38                                             ` Christopher Faylor
2014-02-13 15:37                                               ` Corinna Vinschen
2014-02-13 15:48                                                 ` Christopher Faylor
2014-02-13 16:09                                                   ` Corinna Vinschen
2014-02-13 18:33                                             ` get rid of getpwent? Achim Gratz
2014-02-13 19:02                                               ` Andrey Repin
2014-02-13 20:41                                               ` Corinna Vinschen
2014-02-13 21:48                                                 ` Achim Gratz
2014-02-14  9:46                                                   ` Corinna Vinschen
2014-02-12  4:40                                 ` get rid of getpwent? (Was: cygwin-1.7.28 getpwent header declaration changes ?) Andrey Repin
2014-02-07 20:09           ` Warren Young
2014-02-07 20:25             ` Warren Young
2014-02-07 21:01               ` Corinna Vinschen
2014-02-07 21:30             ` Corinna Vinschen
2014-02-07 21:49               ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-02-08 10:38                 ` Corinna Vinschen
2014-02-08 21:29                   ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-02-09  1:29                     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2014-02-07 21:44             ` Larry Hall (Cygwin)
2014-02-07 22:45               ` David Stacey
2014-02-07 23:39                 ` Larry Hall (Cygwin)
2014-02-08  0:50                   ` Andrey Repin
2014-02-08 15:19                     ` Warren Young
2014-02-08 15:39                       ` Warren Young [this message]
2014-02-09 20:06   ` cygwin-1.7.28 getpwent header declaration changes ? Marco Atzeri
2014-02-09 20:20     ` Corinna Vinschen
2014-02-10 16:14       ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=707CF923-5BCD-477F-A376-6E099E67697F@etr-usa.com \
    --to=warren@etr-usa.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).