Actually, only the ILE Compilers produce w-code. According to Dr. Soltis' "Fortress Rochester: The Inside Story of the IBM iSeries (pp. 138-143)" , the OPM compilers produce Intermediate Representation of a Program (IRP) code, which is converted to the OPM template containing MI instructions via the Program Resolution Monitor (PRM). On a v4 and later RISC system, the OPM Template is then converted to an ILE template via "Magic" (that's what IBM actually calls the component responsible :) The ILE compilers produce w-code, which is converted to an ILE template by the compiler back-end known as CUBE-3 (Common Use Back End - Generation 3). Note that EPM compilers produce U-code, which is converted by CUBE-1 into IRP then on into a OPM template. While both a native ILE template and a "magically" converted ILE template are passed to the ILE optimizing translator (OX), it is important to note that w-code and CUBE-3 are "designed to very efficiently support RISC processors." While I've never really looked for it, here's at least two people who report run-time improvements simply by going from RPG III to RPG IV using CRTRPGSRC:
http://archive.midrange.com/rpg400-l/200311/msg00057.html (5-15%)
http://archive.midrange.com/rpg400-l/200501/msg00526.html (50%) Given the above, I might have to go looking for a test case, if I do, I'll post the results I get. Brabara Morris, of the IBM RPG compiler team had the following to say in response to the second message above:
http://archive.midrange.com/rpg400-l/200501/msg00528.html There are a few areas where the ILE RPG compiler runs faster because of
the way the compiler and runtime are coded. For example, the handling
of eof and record-not-found is much faster for ILE RPG. Also, program
initialization is much faster when you have no PSDS or a small PSDS
(this is most dramatic when the called program returns immediately).
There may be some difference due to the fact that the ILE RPG runtime is
statically bound and the OPM runtime is not, but this may not be as big
a difference as you'd expect, because the OPM RPG runtime is used much
less than the ILE RPG runtime. Many OPM RPG programs only call the
initialization runtime program; all the code is generated directly into
the program rather than calling out to the runtime; system programs for
file handling are called directly from the generated code.
I think most of the difference is due to the optimizating translator
used by the ILE compilers, which takes the code generated by the
compiler and generates machine code.
Another thing to consider is that the ILE RPG compiler and the back-end components continue to improved. Whereas, the OPM RPG components haven't been updated in 15+ years. Like Crispin, we do all new programs as RPG IV. Anytime we modify an existing RPG III generated program, it gets converted to RPG IV. I also agree with Crispin about the continued support of RPG III is holding back the Plex product. Honestly Daniel, I don't consider Plex generated RPG IV to be RPG IV. It's simply RPG III with the column spacing adjusted so that the RPG IV compiler will accept it. It doesn't appear that you even have two separate generators. Instead there's one generator with a handful of IF statements that control the column spacing to use and the choice between d-specs or i-specs. You don't make use of any RPGIV enhancements like EVAL and the other extended factor-2 opcodes, %BIFS(), long names or new data types like DATE, INTEGER and VARYING length strings. Heck you want to see a big performance improvement? Change to INTEGER data types wherever possible and using VARYING strings when doing string manipulation. Want even better performance? Give us ILE RPG support with bound Procedure calls instead of dynamic program calls. Another easy way to improve performance, use SQL DDL to defined physical tables and (most) views instead of DDS. That's a significant performance increase that can be had without needing to regen/recompile any programs that use the files. It'd be an easy option for you folks, you already generate the SQL DDL for every other varient. I'm actually considering writing my own post-processor so that our Plex generated DDS can be converted to SQL DDL auto-magically. Last but not least, from a performance perspective get rid of OPNQRYF when dealing with views that contain virtuals and use embedded SQL like every other varient. While you're at it, let us use embedded via the SELECT WHERE AD statement and related. I've only been using Plex for a year, I like the product and the possibilities. But I also like the IBM System i and I am concerned that Plex has never moved forward in relation to the System i. I'm not asking for v6r1 capabilities, instead I'd like to have v3r1 capabilities that have been available for 15+ years. Heck, you're just now giving us 10-character objects names. Plex would be a natural fit for ILE RPG and SQL, it's to bad Plex is stuck with RPG III. I had somebody contact me from an System i mailing list wanting my opinions about Plex...I told them honestly that the product was impressive, but disappointing in its support of the System i vs. other platforms. Charles