|
Another random thought would be to write the process with a servicing program in the front that merely reads the records and spits the records out to a dataque. Then, have a several instances of the processing program running at one time and pulling records off the dataque as needed. Total elapsed clock time could be substantially less perhaps? --------------------------------------------------------- Booth Martin http://www.MartinVT.com Booth@xxxxxxxxxxxx --------------------------------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: Friday, June 20, 2003 2:19:02 PM To: RPG programming on the AS400 / iSeries Subject: Re: lookups and performance Pete, I think you're right on the %lookup and sorta things - the sorta's only going to take a sec at the very beginning, and hans assures me that my lookups will take no more than 10 or so iters, so i'll be looking other places for more savings. I've already cut a 6 hour update down to a couple (I think that's how long it'll take, i'm using a smaller test file for benching). my next savings will probably be what you've described. I've not used userspaces yet (i don't think - maybe that's what I'm doing when I allocate space in an rpg program, don't know for sure) but would be willing to try. I'd at least like to exit and return multiple records (say, at least a hundred at a time?). Maybe, I could add a 'number of recs to read' parm to my read function and let it do that. not sure how though - i'm using the _C_IFS_fgets function, and it gets a record at a time. If i just call it a hundred times, i don't know what i'd be saving. I know you can specify the number of bytes to get in the read() function. that'd something to try. do you have a good and simple example of a program that uses userspace? thanks for the thought-food. Rick I wonder whether there's any benefit to be derived from calling C-functions instead of doing the RPG ops, e.g. qsort rather than SORTA and bsearch rather than %lookup? Probably not. Maybe Bob Cozzi would know but I wouldn't be surprised if, under the covers, SORTA actually uses qsort and %lookup actually calls bsearch! One other question. How are you reading the records from the IFS? Are using the UNIX-style APIs ("read") etc.? If so, are you calling "read" 2 million times specifying a small buffer size (the record length)? You might find it's quicker to read the whole file (or as much as will fit) into a maximum size user space with a single "read" operation and then process the the buffer. Pete _______________________________________________ This is the RPG programming on the AS400 / 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. .
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.