On 2014-03-28 16:29, Robin Vowels wrote: > From: "John Walker" <[email protected]> > Sent: Saturday, March 29, 2014 1:06 AM > > >> . As an example, I wrote something in Rexx that took 3 hours to run. I >> converted to Assembler, >> and it took 3 SECONDS to run. > > You are comparing an interpreter with machine code. Of course there's a > differemce. > You could have obtained a similar improvement had you written the job > in a HLL such as PL/I (after all, Rexx source us not unlike PL/I). > > But you didn't say how long it took you to write the code in Rexx and in > Assembler. > And, for a factor of several thousand, I suspect a difference in algorithms, or a poor implementation choice -- too many external function calls, or the wrong functions. Linear searches of what should be associative compound variables, building strings one character at a time, etc.
I once had a Rexx EXEC that was spending several hundred milliseconds in each call to DATE(). Large STEPLIB concatenation being searched at each call. PMR. WAD. Rationale: format of DATE is locale-dependent. Couldn't it be cached? No, because locale might be changed dynamically and must be loaded at each call for DATE(). Solution was to use a specific variant of DATE(specific), not the default. But, Grrr! Your example is probably proprietary; not available for inspection. But I'd like to see any compact example, from anyone, with a factor of 1000 or more. I'll take it as a challenge to rewrite the Rexx. -- gil
