[llvm-commits] Review Request: llvm-test-suite disabling unix-smail's call to getpwent()

Chandler Carruth chandlerc at google.com
Fri Apr 6 14:46:10 PDT 2012


FWIW, I would love to see this, and any other things that can possibly
touch pwent stuff disabled in the test suite.

Consider a system which is connected to a massive LDAP NSS, causing these
function calls to actually be network operations. ;] It's terrible.

On Fri, Apr 6, 2012 at 11:35 PM, Joel Jones <joel_k_jones at apple.com> wrote:

> After reviewing the performance characteristics over time of the
> unix-smail benchmark with
> Daniel Dunbar, we determined that the majority of the run-time was spent
> inside of getpwent(),
> which is a library routine which gets information about  users authorized
> to access the system
> the test runs on.  This is not suitable for a performance benchmark, as
> the input may not be
> stable from one run to another.  The number of users may in /etc/passwd
> may change and/or
> the number of users authorized using some kind of network authorization
> mechanism may change
> as well.
>
> Joel
>
> Index: MultiSource/Benchmarks/Prolangs-C/unix-smail/pw.c
> ===================================================================
> --- MultiSource/Benchmarks/Prolangs-C/unix-smail/pw.c   (revision 153796)
> +++ MultiSource/Benchmarks/Prolangs-C/unix-smail/pw.c   (working copy)
> @@ -135,11 +135,20 @@
>        unsigned int i;
>        static int pw_eof = 0;
>
> -       if((pw_eof == 1)
> -       || ((pwent = getpwent()) == (struct passwd *) NULL)) {
> +/*
> +** Performance measurements indicate that the majority of time this
> +** application spends is in getpwent(). As getpwent just tests how
> +** many authorized users there are, don't do the call.
> +*/
> +
> +/*     if((pw_eof == 1)
> +**     || ((pwent = getpwent()) == (struct passwd *) NULL)) {
> +*/
>                pw_eof = 1;
>                return(PNULL);
> -       }
> +/*
> +**     }
> +*/
>        /*
>        ** Get an entry from the password file.
>        ** Parse relevant strings.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120406/c78b43d4/attachment.html>


More information about the llvm-commits mailing list