× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



> ----- Original Message -----
> From: "Fisher, Don" <Dfisher@roomstoreeast.com>
> Subject: Array efficiency (was:Dynamic Arrays)


> Why do you believe array processing to be less efficient than file
> processing?  I would think there would be more overhead associated with
> using physical files since they consume disk space and maintain indexes.

Sure, files have overhead.  But so do arrays when using indexed elements in
an RPG program.

And, in the final analysis, the file or user index approach DOES give the
ability to dynamically allocate the space for the list of data that you
would otherwise have in an array.

In terms of array performance, I'm talking about resolving references in the
code to indexed array elements...when you use a reference to  ARRAY,X in the
program, this has to be resolved (every time) to the address of the array
element.

>From the Performance Management Redbook, section 10.8.8.2:
http://www.redbooks.ibm.com/redbooks/GG243723/css/GG243723_275.html

For the sake of discussion, lets say that I'm using a work file INSTEAD of
an array in my program.

What is more efficient to determine if the value is NOT in the list:  KEY
SETLLWKFILE and using %FOUND or an = indicator, OR ' ' LOKUPARRAY,1 (or
%LOOKUP) to find an unused element in the array?

Since SETLL doesn't actually perform an I/O, I would guess that it is quite
efficient.  I may be totally wrong...but, having grown up on a farm, my mom
always said that I would argue with a fence post!

Steve Landess
Austin, Texas
(512) 423-0935

Donald R. Fisher, III
Project Manager
The Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@roomstoreeast.com

<clip>
IIRC, array processing is one of the most inefficient things that you can do
in an RPG program.
<clip>
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.