Hi Folks
I put my mem speed test code and results on here - incase anyone else wants to try it - or spots any
errors in my code
I ran at 240mhz, spiram @ 80mhz
Ram Speed Test!
Read Speed 8bit ArraySize 1kb time: 0.0 22.6 mb/sec
Read Speed 8bit ArraySize 2kb time: 0.0 22.8 mb/sec
Read Speed 8bit ArraySize 4kb time: 0.0 22.8 mb/sec
Read Speed 8bit ArraySize 8kb time: 0.0 22.9 mb/sec
Read Speed 8bit ArraySize 16kb time: 0.0 22.9 mb/sec
Read Speed 8bit ArraySize 32kb time: 0.1 20.3 mb/sec
Read Speed 8bit ArraySize 64kb time: 0.3 12.0 mb/sec
Read Speed 8bit ArraySize 128kb time: 0.5 12.0 mb/sec
Read Speed 8bit ArraySize 256kb time: 1.0 12.0 mb/sec
Read Speed 8bit ArraySize 512kb time: 0.4 12.0 mb/sec
Read Speed 8bit ArraySize 1024kb time: 0.8 12.0 mb/sec
Read Speed 8bit ArraySize 2048kb time: 1.7 12.0 mb/sec
Read Speed 8bit ArraySize 4000kb time: 3.2 12.3 mb/sec
Read Speed 16bit ArraySize 1kb time: 0.0 45.3 mb/sec
Read Speed 16bit ArraySize 2kb time: 0.0 45.5 mb/sec
Read Speed 16bit ArraySize 4kb time: 0.0 45.6 mb/sec
Read Speed 16bit ArraySize 8kb time: 0.0 45.7 mb/sec
Read Speed 16bit ArraySize 16kb time: 0.0 45.7 mb/sec
Read Speed 16bit ArraySize 32kb time: 0.0 39.8 mb/sec
Read Speed 16bit ArraySize 64kb time: 0.2 17.0 mb/sec
Read Speed 16bit ArraySize 128kb time: 0.4 16.9 mb/sec
Read Speed 16bit ArraySize 256kb time: 0.7 16.9 mb/sec
Read Speed 16bit ArraySize 512kb time: 0.3 16.9 mb/sec
Read Speed 16bit ArraySize 1024kb time: 0.6 16.9 mb/sec
Read Speed 16bit ArraySize 2048kb time: 1.2 16.9 mb/sec
Read Speed 16bit ArraySize 4000kb time: 2.3 17.2 mb/sec
Read Speed 32bit ArraySize 1kb time: 0.0 89.6 mb/sec
Read Speed 32bit ArraySize 2kb time: 0.0 90.3 mb/sec
Read Speed 32bit ArraySize 4kb time: 0.0 91.0 mb/sec
Read Speed 32bit ArraySize 8kb time: 0.0 91.2 mb/sec
Read Speed 32bit ArraySize 16kb time: 0.0 91.4 mb/sec
Read Speed 32bit ArraySize 32kb time: 0.0 76.3 mb/sec
Read Speed 32bit ArraySize 64kb time: 0.1 21.2 mb/sec
Read Speed 32bit ArraySize 128kb time: 0.3 21.2 mb/sec
Read Speed 32bit ArraySize 256kb time: 0.6 21.2 mb/sec
Read Speed 32bit ArraySize 512kb time: 0.2 21.2 mb/sec
Read Speed 32bit ArraySize 1024kb time: 0.5 21.2 mb/sec
Read Speed 32bit ArraySize 2048kb time: 0.9 21.2 mb/sec
Read Speed 32bit ArraySize 4000kb time: 1.8 21.4 mb/sec
Test done!
Code: Select all
// Profile fun! microseconds to seconds
double GetTime() { return (double)esp_timer_get_time() / 1000000; }
int RamTest()
{
int rs[] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4000 };
printf("Ram Speed Test!\n\n");
char xx = 0;
for (int a = 0; a < 13; a++)
{
printf("Read Speed 8bit ArraySize %4dkb ", rs[a]);
int ramsize = rs[a] * 1024;
char * rm = (char*)malloc(ramsize);
int iters = 10; // Just enuff to boot the dog
if (rs[a] < 512) iters = 50;
double st = GetTime();
for (int b = 0; b < iters; b++)
for (int c = 0; c < ramsize; c++)
xx |= rm[c];
st = GetTime() - st;
vTaskDelay(1); // Dog it!
double speed = ((double)(iters*ramsize ) / (1024 * 1024)) / (st);
printf(" time: %2.1f %2.1f mb/sec \n", st, speed);
free(rm);
}
printf("\n");
for (int a = 0; a < 13; a++)
{
printf("Read Speed 16bit ArraySize %4dkb ", rs[a]);
int ramsize = rs[a] * 1024;
short * rm = (short*)malloc(ramsize);
int iters = 10; // Just enuff to boot the dog
if (rs[a] < 512) iters = 50;
double st = GetTime();
for (int b = 0; b < iters; b++)
for (int c = 0; c < ramsize/2; c++)
xx |= rm[c];
st = GetTime() - st;
vTaskDelay(1); // Dog it!
double speed = ((double)(iters*ramsize) / (1024 * 1024)) / (st);
printf(" time: %2.1f %2.1f mb/sec \n", st, speed);
free(rm);
}
printf("\n");
for (int a = 0; a < 13; a++)
{
printf("Read Speed 32bit ArraySize %4dkb ", rs[a]);
int ramsize = rs[a] * 1024;
int * rm = (int*)malloc(ramsize);
int iters = 10; // Just enuff to boot the dog
if (rs[a] < 512) iters = 50;
double st = GetTime();
for (int b = 0; b < iters; b++)
for (int c = 0; c < ramsize/4; c++)
xx |= rm[c];
st = GetTime() - st;
vTaskDelay(1); // Dog it!
double speed = ((double)(iters*ramsize) / (1024 * 1024)) / (st);
printf(" time: %2.1f %2.1f mb/sec \n", st, speed);
free(rm);
}
printf("Test done!\n");
return xx;
}