From: Asfand Yar Qazi Date: 2004-04-06T02:44:19+09:00 Subject: Re: Learning Ruby, was a C geek... > > > This is a project similar in scope to an NES emulator I've written in C. When doing so, I tried and benchmarked 2 situations: > > switch (opcode) { > case 0x01: > case 0x02 ... (etc, for every opcode) > } > > And: > typedef void (*operand)(address); > operand opcodes[0x100]; (You'd use 0x10) > op_0x01(int address) { ... } > opcodes[0x01] = op_0x01. > Then call using: opcodes[0x01](addr); > AARRGH! The suspense is killing me! Which was faster?!!! -- http://www.it-is-truth.org/