On 24/10/2014 6:50 AM, Bernd Oppolzer wrote:
Doesn't the example in the benchmark show performance problems in EXECIO
instead of REXX? EXECIO, IMO, is not part of the REXX interpreter, but
instead
it is a vehicle (an external function) to do I/O from REXX on z/OS.
Other REXX implementations
(for example, on Linux or Windows) don't use EXECIO etc.; I/O there is
done with
native REXX functions.
I don't want to be too disparaging about REXX but I've profiled it
extensively and it is not an effecient implementation. The variable
access routines are where it spends a lot of time so any address SUBCOM
interface is slow
when compared to fast scripting languages. Compiled REXX has a serious
flaw in it's memory management. I profiled it using IBM APA and it
appears to do a GETMAIN every time it wants a new stem varaible element.
It could be dramatically improved just be using a better storage
manager. I would want my money back if I paid for the REXX compiler.
So to be fair, the REXX interpreter functions should be compared with Lua
interpreter functions, for example: some loop control or arithmetic.
Compiled languages like C will always outperform interpreted languages
in this area, so such comparisons are only of academic interest.
Lua is written in C and the majority of it's libraries are too. In some
cases there is only 10% overhead for the Lua VM. I've got an SQL
bench-test where Lua is not too far off C. And much easier to code and
maintain.
OK, let's try simple matrix multiplication which should test both array
access and math.
/* REXX */
arg count
if count = "" then count = 1000000
start = sysvar("SYSCPU")
do i = 1 to count
a.i = i * i
end
say 'CPU time = 'sysvar("SYSCPU") - start
CPU time = 3.57
local t = require("timer")()
local count = arg[1] or 1000000
local a = {}
for i = 1, count do a[i] = a[i] * i end
t:print_elapsed()
elapsed time: 0.131965
That's a huge difference, two orders of magnitude.
Kind regards
Bernd
Am 24.10.2014 00:24, schrieb Shane Ginnane:
Good one Dave, glad you were able to convince your "powers that be"
to get this out the door.
Let's hope it gets some acceptance.
Now you have Lua installed why don't you bench-test it against REXX and
report if you get similar results to what I get on my machine
Now don't you go training everybody out there as to what a slug REXX
really is ... ;-)
Shane ...
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN