Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 May 1998 15:51:23 +0800
From:      Joerg Micheel <joerg@krdl.org.sg>
To:        Greg Lehey <grog@lemis.com>
Cc:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>, FreeBSD Hackers <hackers@FreeBSD.ORG>
Subject:   Re: Context switch time
Message-ID:  <19980504155123.20764@krdl.org.sg>
In-Reply-To: <19980504171054.X4777@freebie.lemis.com>; from Greg Lehey on Mon, May 04, 1998 at 05:10:54PM %2B0930
References:  <Pine.BSF.3.96.980425041329.28708A-100000@fledge.watson.org> <19980425034313.55993@hydrogen.nike.efn.org> <19980504143736.L4777@freebie.lemis.com> <19980503222303.36966@hydrogen.nike.efn.org> <19980504140442.52763@krdl.org.sg> <19980504155242.P4777@freebie.lemis.com> <19980504152056.47011@krdl.org.sg> <19980504171054.X4777@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 04, 1998 at 05:10:54PM +0930, Greg Lehey wrote:
> On Mon,  4 May 1998 at 15:20:56 +0800, Joerg Micheel wrote:
> 
> Hmm, interesting, it's called getpid.c, but it calls getuid :-)

Ha! That's the bottleneck! :-)))).

Ok. Just for completeness sake:

The initial test program obviously was:

# include <unistd.h>
void
main()
{
	for(;;)
		(void)getpid();
}

which has been converted to:

# include	<stdio.h>
# include	<unistd.h>
# include	<sys/time.h>

void
main()
{
	int		loop = 1000000;
	long long       total;          /* in usecs */

	while(loop--) {
		gettimeofday(&start, NULL);
		while(loop--)
			(void)getpid();
		gettimeofday(&stop, NULL);
	}
	total = ((long long)stop.tv_sec * 1000000 + (long long)stop.tv_usec)
		- ((long long)start.tv_sec * 1000000 + (long long)start.tv_usec);
	printf("%qd\n", total);
}

I just put another loop around it and computed the calls/sec in the
latest version.

> Hmmm.  This suggests to me that we're hitting some other limit.

	Joerg

-- 
Joerg B. Micheel			Email: <joerg@krdl.org.sg>
SingAREN Technology Center		Phone: +65 7705577
Kent Ridge Digital Labs			Fax:   +65 7795966
11 Science Park Road			Pager: +65 96016020
Singapore Science Park II		Plan:  Troubleshooting ATM
117685 Singapore			       Networks and Applications

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980504155123.20764>