parrotcode: Benchmark one or more opcodes | |
Contents | Tools |
bench_op - Benchmark one or more opcodes
parrot bench_op.pir 'add $I0, $I1, $I2'
parrot bench_op.pir --preops='newclass $P0, "Foo"' file_w_ops.pir
parrot bench_op.pir --help
The given opcode(s) are compiled into a sequence:
.sub _entry0
.param int N
.local int i
#
# preops go here
#
null i
loop:
#
# ops go here
#
inc i
lt i, N, loop
.end
so they should conform to Parrot Calling Conventions. The code gets executed with the PIR compiler - using symbolic variables is always ok.
Output is the time in seconds for 1.000.000 instruction(s).
You can't use the variables i and N nor the labels loop: and _entry\d in your opcodes.
Leopold Toetsch <lt@toetsch.at>
|