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

Chris Lattner clattner at apple.com
Fri Apr 6 21:37:14 PDT 2012


On Apr 6, 2012, at 2:35 PM, Joel Jones 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.

LGTM, you can also just delete the code outright.  Thanks Joel,

-Chris

> 
> 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




More information about the llvm-commits mailing list