(out-of-band) performance with gcc3

duchier at ps.uni-sb.de duchier at ps.uni-sb.de
Thu Jan 22 18:07:33 CET 2004


Kostja,

could you perform some timings for the program attached below when
compiled with gcc 2.95 and with 3.3.2?  Following a query on the gcc
list, I am attempting to measure whether the difference in compilation
have any measurable effect.

-------------- next part --------------
void* program[1000];
int counter = 0;

static const unsigned int AGAIN = 1000000;

#define DISPATCH(N) goto ** (PC+=N)

void foo (bool init)
{
  if (init) {
    for (int i=0;i<999;i++) program[i] = && DECR;
    program[999] = && HALT;
    return;
  } else {
    void ** PC = program;
    unsigned int again = AGAIN;
    DISPATCH(0);
  DECR:
    counter += 1;
    DISPATCH(1);
  HALT:
    {
      again -= 1;
      if (again)
	{
	  PC=program;
	  DISPATCH(0);
	}
      return;
    }
  }
}

int main()
{
  foo(true);
  foo(false);
}
-------------- next part --------------

-- 
Denys Duchier - ?quipe Calligramme - LORIA, Nancy, France


More information about the mozart-hackers mailing list