plan 9 kernel history: overview | file list | diff list

2001/0527/mpc/memspeed.c (diff list | history)

2000/0516/sys/src/9/mpc/memspeed.c:1,532001/0527/sys/src/9/mpc/memspeed.c:0 (short | long | prev)
Deleted.
rsc Mon Mar 7 10:28:44 2005
2000/0516    
#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); 
} 
                 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)