Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/mpc/memspeed.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname mpc/memspeed.c 2000/0516
## diff -e /dev/null /n/emeliedump/2000/0516/sys/src/9/mpc/memspeed.c
0a
#include	"u.h"
#include	"../port/lib.h"
#include	"mem.h"
#include	"dat.h"
#include	"fns.h"
#include	"io.h"

char	d0[1000008], d1[1000008];

static void	test(int size, int align);


void
memspeed()
{
	int j;

	spllo();

	memmove(d0, d1, sizeof(d0));
	
	for(j = 0; j<8; j++)
		test(12, j);
	for(j = 0; j<8; j++)
		test(100, j);
	for(j = 0; j<8; j++)
		test(400, j);
	for(j = 0; j<8; j++)
		test(1000, j);
	for(j = 0; j<8; j++)
		test(10000, j);
	for(j = 0; j<8; j++)
		test(100000, j);
	for(j = 0; j<8; j++)
		test(1000000, j);
}

static void
test(int size, int align)
{
	int n;
	int t;

	t = -TK2MS(m->ticks);
	n = 10000000/size;
	while(n) {
		memmove(d0+align, d1, size);
		n--;
	}
	t += TK2MS(m->ticks);
	print("size = %d align = %d KB/s %d %d\n", size, align, 10000000/t, t);
}

.
## diffname mpc/memspeed.c 2001/0527 # deleted
## diff -e /n/emeliedump/2000/0516/sys/src/9/mpc/memspeed.c /n/emeliedump/2001/0527/sys/src/9/mpc/memspeed.c
1,53d

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.