× 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.



Oh, and I also tried Setll instead of chain, expecting a big difference.
But for 10,000,000 operations the difference between Setll and Chain was 4
seconds.

On Mon, Apr 24, 2017 at 10:25 AM, Vinay Gavankar <vinaygav@xxxxxxxxx> wrote:

Here you go.

Physical File



A R AAR

A*---------------------------------------------

A FLD1 3

A FLD2 15

A FLD3 50



Logical File



A R AA1R

A PFILE(AA)

A FLD1

A FLD2

A FLD3

A* Key fields

A K FLD1

A K FLD2



Data Area

Data area . . . . . . . : APSYSELGA

Library . . . . . . . : QGPL

Type . . . . . . . . . : *CHAR

Length . . . . . . . . : 1

Text . . . . . . . . . :



Value

Offset *...+....1....+....2....+....3....+....4....+....5

0 '1'



RPG



FAA1 IF E K DISK

D elg S 1A dtaara(APSYSELGA)

DTS S 10

DTS1 S z

DTS2 S z

*

C keyaa1 klist

C kfld fld1

C kfld fld2

*

C eval TS1 = %timestamp()

*

C do 1000000

C eval fld1 = 'CMS'

C eval fld2 = 'CMSMMR'

C keyaa1 Chain AA1

C If not %found(AA1) /* put this in to ensure
the record was found */

C 'NF' dsply

C endif

C enddo

*

C eval TS2 = %timestamp()

C eval TS = %Char(%diff(TS2:TS1:*s))

C TS dsply

*

C eval TS1 = %timestamp()

*

C do 1000000

C in elg

C enddo

*

C eval TS2 = %timestamp()

C eval TS = %Char(%diff(TS2:TS1:*s))

C TS dsply

*
C EVAL *Inlr = *On



On Sun, Apr 23, 2017 at 9:32 AM, Mark S Waterbury <
mark.s.waterbury@xxxxxxxxxxxxx> wrote:

Vinay:

I would like to see the source of your "benchmark" tests accessing a
data area vs. a record in a file, so that I can run the same tests, to
compare results, etc.

You could post that benchmark source to http://code.midrange.com and
then include the generated "link"in a reply to the list, so anyone who is
interested in reproducing your results can see the source you used,
for an "apples-to-apples" comparison.

Thanks

Mark


On 4/21/2017 5:42 PM, Vinay Gavankar wrote:

Hi,

We have a program where same record of a 'control' file (input mode) is
being read for every iteration, and I thought that replacing the 'Chain'
with reading a dataarea.

So I ran a simple test to compare the time taken to read one record in
file
100,000 times and reading a data area 100,000 times with 'IN' statement.

I was surprised that the file was read under 1 sec, whereas dataarea took
around 4-5 seconds.

Just to make sure, I looped for a million times. The file came in at 4
seconds and dataarea at 47 seconds.

I was wondering whether I am missing something or accessing a dataarea
with
an 'IN' statement takes that long compared to file read.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.