RE: [U2] Universe 20.1 itype perf enhancer
The only thing we do also, which others may have commented on, is to add the ACCOUNT into the 'search' - otherwise, if the user logs from LIVE to TEST, and the file names are the same, you are writing and reading from your LIVE data since the file name was 'found' in the list. So our 'locate' is ACCOUNT*FILENAME... Or if you want, store the account elsewhere in COMMON, and if not the same, clear the DIM structure. DW -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger Sent: Thursday, January 24, 2008 11:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Universe 20.1 itype perf enhancer Hi John, As you surmised, this is not a new trick. Here is my version: SUBROUTINE OPEN.FILE.SUB(FILENAME,FILEVAR,ERROR) * open filename to filevar, keep opened files in named common * 01-20-01 asb COMMON /OPEN.FILE.SUB/ FILENAMES,FILEVARS(1000) IF ASSIGNED(FILENAMES) ELSE FILENAMES = END ERROR = LOCATE(FILENAME,FILENAMES;POS) THEN FILEVAR = FILEVARS(POS) END ELSE OPEN FILENAME TO FILEVAR THEN IF POS LE 1000 THEN FILENAMESPOS = FILENAME FILEVARS(POS) = FILEVAR END END ELSE FILEVAR = ERROR = 1 CRT @(0):ERROR! can't open :FILENAME:@(-4) END END RETURN In use, you CALL OPEN.FILE.SUB(MYFILE,FILEVAR,ERR) ; IF ERR THEN Interestingly, on D3 this does not seem to have much benefit, where the OPEN function seems faster than the LOCATE. /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Universe 20.1 itype perf enhancer
On Jan 24, 2008 3:31 PM, Bernard Lubin [EMAIL PROTECTED] wrote: As the common block remains alive for the duration of your login, you will also need to take into account cross-logging across multiple accounts. Oh yes, absolutely. Essential note here! --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Universe 20.1 itype perf enhancer
Hi John, As you surmised, this is not a new trick. Here is my version: SUBROUTINE OPEN.FILE.SUB(FILENAME,FILEVAR,ERROR) * open filename to filevar, keep opened files in named common * 01-20-01 asb COMMON /OPEN.FILE.SUB/ FILENAMES,FILEVARS(1000) IF ASSIGNED(FILENAMES) ELSE FILENAMES = END ERROR = LOCATE(FILENAME,FILENAMES;POS) THEN FILEVAR = FILEVARS(POS) END ELSE OPEN FILENAME TO FILEVAR THEN IF POS LE 1000 THEN FILENAMESPOS = FILENAME FILEVARS(POS) = FILEVAR END END ELSE FILEVAR = ERROR = 1 CRT @(0):ERROR! can't open :FILENAME:@(-4) END END RETURN In use, you CALL OPEN.FILE.SUB(MYFILE,FILEVAR,ERR) ; IF ERR THEN Interestingly, on D3 this does not seem to have much benefit, where the OPEN function seems faster than the LOCATE. /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 On Jan 24, 2008 6:56 AM, john reid [EMAIL PROTECTED] wrote: I just saw this today, and although i am certain that everyone must know it already, i am including it. For itypes that call subroutines, where the subroutines open lots of files, put a named common in the subroutine that contains what amounts to dimensioned arrays that hold the file vars. Put a switch in so that the files are opened only once. Anecdotally, this appears to work more efficiently than not having the common. If there are reasons why this is ill-advised, I'd like to see that as well. thanks. John COMMON /SETUP.STUFF/MY.FILES(15),FIRST.IN.SWITCH -- john --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Universe 20.1 itype perf enhancer
This is good stuff. However, two things to keep in mind. The name of the common block must be unique so that it doesn't inadvertently collide with other programs. Named common stays alive your entire login session so if you use the same name with different configurations you could break something else in the system by having two routines with the same common block name and different configurations. Second, and I don't know if this applies to UV but I'm pretty sure it applies to UD, the name of the named common can only be up to 7 characters in length. The performance gains by this technique can be immense, especially on UV (that seems to have a little more overhead than UD in opening files). Regardless of the platform, the less code executed in each iteration, the more efficient the program. On Jan 24, 2008 7:56 AM, john reid [EMAIL PROTECTED] wrote: For itypes that call subroutines, where the subroutines open lots of files, put a named common in the subroutine that contains what amounts to dimensioned arrays that hold the file vars. Put a switch in so that the files are opened only once. COMMON /SETUP.STUFF/MY.FILES(15),FIRST.IN.SWITCH --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Universe 20.1 itype perf enhancer
Hi all, UniVerse and SB+ also have this technique built in. UniVerse is via the OPEN.FILE.B in the APP.PROGS file (uv account) and SB+ via the SB.FILEVAR.S subroutine. I had written an article regarding the UniVerse routines: http://u2blog.org/2007/11/05/appprogs-open-tools/ Cheers, David Murray .learn and do .excel and share -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger Sent: Thursday, January 24, 2008 11:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Universe 20.1 itype perf enhancer Hi John, As you surmised, this is not a new trick. Here is my version: SUBROUTINE OPEN.FILE.SUB(FILENAME,FILEVAR,ERROR) * open filename to filevar, keep opened files in named common * 01-20-01 asb COMMON /OPEN.FILE.SUB/ FILENAMES,FILEVARS(1000) IF ASSIGNED(FILENAMES) ELSE FILENAMES = END ERROR = LOCATE(FILENAME,FILENAMES;POS) THEN FILEVAR = FILEVARS(POS) END ELSE OPEN FILENAME TO FILEVAR THEN IF POS LE 1000 THEN FILENAMESPOS = FILENAME FILEVARS(POS) = FILEVAR END END ELSE FILEVAR = ERROR = 1 CRT @(0):ERROR! can't open :FILENAME:@(-4) END END RETURN In use, you CALL OPEN.FILE.SUB(MYFILE,FILEVAR,ERR) ; IF ERR THEN Interestingly, on D3 this does not seem to have much benefit, where the OPEN function seems faster than the LOCATE. /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 On Jan 24, 2008 6:56 AM, john reid [EMAIL PROTECTED] wrote: I just saw this today, and although i am certain that everyone must know it already, i am including it. For itypes that call subroutines, where the subroutines open lots of files, put a named common in the subroutine that contains what amounts to dimensioned arrays that hold the file vars. Put a switch in so that the files are opened only once. Anecdotally, this appears to work more efficiently than not having the common. If there are reasons why this is ill-advised, I'd like to see that as well. thanks. John COMMON /SETUP.STUFF/MY.FILES(15),FIRST.IN.SWITCH -- john --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Universe 20.1 itype perf enhancer
Thanks all... john On 1/24/08, David Murray [EMAIL PROTECTED] wrote: Hi all, UniVerse and SB+ also have this technique built in. UniVerse is via the OPEN.FILE.B in the APP.PROGS file (uv account) and SB+ via the SB.FILEVAR.S subroutine. I had written an article regarding the UniVerse routines: http://u2blog.org/2007/11/05/appprogs-open-tools/ Cheers, David Murray .learn and do .excel and share -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger Sent: Thursday, January 24, 2008 11:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Universe 20.1 itype perf enhancer Hi John, As you surmised, this is not a new trick. Here is my version: SUBROUTINE OPEN.FILE.SUB(FILENAME,FILEVAR,ERROR) * open filename to filevar, keep opened files in named common * 01-20-01 asb COMMON /OPEN.FILE.SUB/ FILENAMES,FILEVARS(1000) IF ASSIGNED(FILENAMES) ELSE FILENAMES = END ERROR = LOCATE(FILENAME,FILENAMES;POS) THEN FILEVAR = FILEVARS(POS) END ELSE OPEN FILENAME TO FILEVAR THEN IF POS LE 1000 THEN FILENAMESPOS = FILENAME FILEVARS(POS) = FILEVAR END END ELSE FILEVAR = ERROR = 1 CRT @(0):ERROR! can't open :FILENAME:@(-4) END END RETURN In use, you CALL OPEN.FILE.SUB(MYFILE,FILEVAR,ERR) ; IF ERR THEN Interestingly, on D3 this does not seem to have much benefit, where the OPEN function seems faster than the LOCATE. /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 On Jan 24, 2008 6:56 AM, john reid [EMAIL PROTECTED] wrote: I just saw this today, and although i am certain that everyone must know it already, i am including it. For itypes that call subroutines, where the subroutines open lots of files, put a named common in the subroutine that contains what amounts to dimensioned arrays that hold the file vars. Put a switch in so that the files are opened only once. Anecdotally, this appears to work more efficiently than not having the common. If there are reasons why this is ill-advised, I'd like to see that as well. thanks. John COMMON /SETUP.STUFF/MY.FILES(15),FIRST.IN.SWITCH -- john --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ -- john --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Universe 20.1 itype perf enhancer
As the common block remains alive for the duration of your login, you will also need to take into account cross-logging across multiple accounts. If you have multiple accounts, then you will need to reset the common block whenever you logto another account. Alternatively, you could build some logic in the subroutine to check whether you have just logged into another account. Rgds Bernard Lubin Development Department Reynolds and Reynolds -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of john reid Sent: Friday, 25 January 2008 1:56 AM To: list Subject: [U2] Universe 20.1 itype perf enhancer I just saw this today, and although i am certain that everyone must know it already, i am including it. For itypes that call subroutines, where the subroutines open lots of files, put a named common in the subroutine that contains what amounts to dimensioned arrays that hold the file vars. Put a switch in so that the files are opened only once. Anecdotally, this appears to work more efficiently than not having the common. If there are reasons why this is ill-advised, I'd like to see that as well. thanks. John COMMON /SETUP.STUFF/MY.FILES(15),FIRST.IN.SWITCH -- john --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Universe 20.1 itype perf enhancer
In message [EMAIL PROTECTED], Kevin King [EMAIL PROTECTED] writes The performance gains by this technique can be immense, especially on UV (that seems to have a little more overhead than UD in opening files). Regardless of the platform, the less code executed in each iteration, the more efficient the program. Pr1me was apparently especially notorious in this regard ... in fact I believe that's where the technique came from. If using INFORMATION, this trick would speed programs up noticeably. Cheers, Wol -- Anthony W. Youngman [EMAIL PROTECTED] 'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998 Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Universe 20.1 itype perf enhancer
Yes Pr1me had a few other tricks as well. One useful item was that any Pr1ME Information client session only ever had ONE remote process when accessing over Pr1menet, and the process was kept alive as long as you had an active remote lock. As a result, the overheads of starting a remote process repeatedly could be avoided by reading ONE record on a remote file with LOCK and hanging onto the lock like grim death. Hum Don't get me started on Pr1me Information catalogued program Garbage Collect. Getting GCI at release 6 was fantastic (I was at the launch in Copenhagen - Dennis Beldotti [ organiser ] and Bent Pristed [ host ] I seem to recall). And what hosts !! Regards JayJay -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony W. Youngman Sent: 24 January 2008 22:41 To: u2-users@listserver.u2ug.org Subject: Re: [U2] Universe 20.1 itype perf enhancer In message [EMAIL PROTECTED], Kevin King [EMAIL PROTECTED] writes The performance gains by this technique can be immense, especially on UV (that seems to have a little more overhead than UD in opening files). Regardless of the platform, the less code executed in each iteration, the more efficient the program. Pr1me was apparently especially notorious in this regard ... in fact I believe that's where the technique came from. If using INFORMATION, this trick would speed programs up noticeably. Cheers, Wol -- Anthony W. Youngman [EMAIL PROTECTED] 'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998 Visit the MaVerick web-site - http://www.maverick-dbms.org Open Source Pick --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Universe 20.1 itype perf enhancer
Are you saying that this technique won't work till version 20.1 is released? =8^D --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Universe 20.1 itype perf enhancer
I believe the technique is only REQUIRED on versions prior to 20.1! Ross Ferris Stamina Software Visage Better by Design! -Original Message- From: [EMAIL PROTECTED] [mailto:owner-u2- [EMAIL PROTECTED] On Behalf Of Ray Wurlod Sent: Friday, 25 January 2008 1:15 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Universe 20.1 itype perf enhancer Are you saying that this technique won't work till version 20.1 is released? =8^D --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/