In message <[EMAIL PROTECTED]>
          Daniel Grunblatt <[EMAIL PROTECTED]> wrote:

> All:
>       Here's a list of the things I've been doing:
> 
> * Added ops2cgc.pl which generates core_cg_ops.c and core_cg_ops.h from
> core.ops, and modified Makefile.in to use it. In core_cg_ops.c resides
> cg_core which has an array with the addresses of the label of each opcode
> and starts the execution "jumping" to the address in array[*cur_opcode].
> 
> * Modified interpreter.c to include core_cg_ops.h
> 
> * Modified runcore_ops.c to discard the actual dispatching method and call
> cg_core, but left everything else untouched so that -b,-p and -t keep
> working.
> 
> * Modified pbc2c.pl to use computed goto when handling jump or ret, may be
> I can modified this once again not to define the array with the addresses
> if it's not going to be used but I don't think that in real life a program
> won't use jump or ret, am I right?
> 
> Hope some one find this usefull.

I just tried it but I don't seem to be seeing anything like the speedups
you are. All the times which follow are for a K6-200 running RedHat 7.2 and
compiled -O6 with gcc 2.96.

Without patch:

  gosford [~/src/parrot] % ./test_prog examples/assembly/mops.pbc
  Iterations:    100000000
  Estimated ops: 300000000
  Elapsed time:  37.387179
  M op/s:        8.024141

  gosford [~/src/parrot] % ./examples/assembly/mops
  Iterations:    100000000
  Estimated ops: 300000000
  Elapsed time:  3.503482
  M op/s:        85.629098

With patch:

  gosford [~/src/parrot-cg] % ./test_prog examples/assembly/mops.pbc
  Iterations:    100000000
  Estimated ops: 300000000
  Elapsed time:  29.850361
  M op/s:        10.050130

  gosford [~/src/parrot-cg] % ./examples/assembly/mops
  Iterations:    100000000
  Estimated ops: 300000000
  Elapsed time:  4.515596
  M op/s:        66.436413

So there is a small speed up for the interpreted version, but nothing
like the three times speedup you had. The compiled version has actually
managed to get slower...

Tom

-- 
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/

Reply via email to