On Sun, 17 Mar 2024 at 11:42, Tom Harper <
000005bfa0e23abd-dmarc-requ...@listserv.ua.edu> wrote:

> David,
>
> Yes, assembler can be used to improve performance.
>
> In the 64 years I have been programming, I have used COBOL for three
> years, C++ for six years, and assembler for 55 years.
>
> But it’s not just the language that affects performance. Design is
> critical and arranging your algorithms in the correct sequence is of the
> utmost importance.
>

It's way more important!

Here are statement counts obtained by the old PL/I Optimizing compiler for
the procedure(s) that produce one particular table:

My old algorithm:

NAT_SCAN  13,685,293,297  99.6441458%

The current algorithm, thanks to a Paul Greeen, and the result from a post
to comp.lang.pascal.borland, almost 26 years ago.

NAT_SCAN         246,805   0.6623430%
DISPOSE_RUN       14,064   0.0377431%
SETUP_RUN        162,060   0.4349154%
CHECK_RUNS     1,229,773   3.3003039%

And for what it's worth, the old counts are probably correct, the transient
library of the optimizing compiler cannot handle counts over 2^31-1, so I
had to add code to emulate the loops according to the PL/I manual, using
FIXED DEC (15) variables.

Now this is only a private program <
https://prino.neocities.org/resources/lift.pli.html>, but I've updated PL/I
code myself reducing ***CPU*** time from well over three hours to just 20
minutes, by just changing two declarations, and while working at a Dutch
airline company, I reduced CPU usage of two PL/I programs calculating CRCs
by more than 99.5%, removing calls to the PL/I library. Hell, if you look
at the current Enterprise PL/I Programming Guide, GI13-5620-00, on PDF page
372 (book page 316) in the "Avoiding calls to library routines" paragraph,
the text that reads

<quote>
When your code refers to a member of a BASED structure with REFER, the
compiler often has to generate
one or more calls to a library routine to map the structure at run time.
These calls can be expensive, and
so when the compiler makes these calls, it will issue a message so that you
can locate these potential
hot-spots in your code.

If you do have code that uses BASED structures with REFER, which the
compiler flags with this message,
you might get better performance by passing the structure to a subroutine
that declares a corresponding
structure with * extents. This will cause the structure to be mapped once
at the CALL statement, but there
will no further remappings when it is accessed in the called subroutine.
</quote>

is almost a literal copy of text in an email I sent to IBM's Peter Elderon
close to 30 years ago, and if you use PL/I to build linked lists, and/or
trees using BASED storage, I'd suggest you think about the second
(area-reference) parameter of the ALLOC builtin function, and the NEXTALLOC
builtin, both are the result of my RFEs, and combining them with the EMPTY
builtin, well think about it. ;)

Robert
--
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather <https://prino.neocities.org/index.html>
Some REXX code for use on z/OS
<https://prino.neocities.org/zOS/zOS-Tools.html>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to