NeXT Memory-Benchmark

Platform:

Intel-Next like you will find under the AMD-NeXT hardware example. What is depicted in the following picture is the memory bandwidth compared to different machines like IBM Mainframes (S390/G3 and G6), IBM Power-Series (S80 and S85), or simple Pentium crap. A NeXT looks like the x-axsis.

© Dr. Henry Koplien

Or if you want to focus on NeXT with different RAM timings and size

© Dr. Henry Koplien

Everyone is able to verify the data, even on their own machines, so no magic! You can do the stuff with a simple C-program like I did:

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

#define MAX_SIZE 0x2000000 // Max 0x20000000
#define SECONDS  1

char       *a, *b;
static int alarmflg;

static void signal_handler(int sig) {
/***********************************/
  switch (sig) {
    case SIGALRM: alarmflg = 1;
                  alarm(0);
                  break;

    default     : fprintf(stderr, "Got Suspect Signal %d\n", sig);
                  exit (-1);
  };
};

void f(int i) {
/*************/
  memcpy(a, b, i);
};

void g(int i) {
/*************/
};

int main(void) {
/***************/
unsigned long  i, j, k;
double         execution;
struct timeval start_time, exec_time, all_time;
                     
  (void) signal(SIGALRM, signal_handler);
  (void) siginterrupt(SIGALRM, 1);

  a = (char *)malloc(MAX_SIZE);
  b = (char *)malloc(MAX_SIZE);

  for (i = 1; i <= MAX_SIZE; i *= 2) {
    alarmflg = 0;
    alarm(1);

    j = 0;
    while (!alarmflg) {
      f(i);
      j++;
    };
    j *= SECONDS;

    gettimeofday(&start_time, NULL);
    for(k = 0; k < j; k++)
      f(i);
    gettimeofday(&exec_time, NULL);
    for(k = 0; k < j; k++)
      g(i);
    gettimeofday(&all_time, NULL);

    execution = 2 * exec_time.tv_sec + 0.000002 * exec_time.tv_usec - all_time.tv_sec - 0.000001 * all_time.tv_usec - start_time.tv_sec - 0.000001 * start_time.tv_usec;

    printf("%d\t%f\n", i, (double)(i)*j / execution / 0x100000);
    fprintf(stderr, "time for copy %d bytes %d times: %fs %f Mbytes/s\n", i, j, execution, (double)(i)*j / execution / 0x100000);
  };

  free(a);
  free(b);

  return 0;
};


© Dr. Henry Koplien