|
Brad -snip- Opinions, history, etc., are interesting, but can we get some facts? I think I'll go generate an IR (intermediate representation). Actually, that might be interesting and even helpful. <bg> =================================================================== Adding to the previous post: I created some little RPG III programs, basically as follows, and specified GENOPT(*LIST), which puts the resulting MI into the source listing. READ (executed only once, so I include in inside read) DOW (adds to size of program) READ 17 MI instruction / loop ENDDO 118 bytes DOU 18 MI instruction / loop READ 128 bytes IF LEAVE ENDIF ENDDO DO 16 MI instruction / loop READ 118 bytes IFEQ LEAVE ENDIF ENDDO It looks like the last one is, in fact, the most efficient. However, looking at the IR, it seems that the first 2 stay in the loop and the last one does not. In fact, I just ran it and that is exactly what happens—it goes through the cycle for each read! Definitely, number one has fewer operations and should be faster. I just ran both over a file of about 9000 records, record length about 450. The DOW took 4 seconds, the DOU 5 seconds. Convinces me! HTH Vernon Hamberg Systems Software Programmer Old Republic National Title Insurance Company 400 Second Avenue South Minneapolis, MN 55401-2499 (612) 371-1111 x480 +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.