General slowdown (AREV Specific)
At 20 AUG 1999 04:43:09AM Giles Wycherley wrote:
Unfortunately the content of this post is going to be pretty vague.
We've recently had reports of general system slowdowns across a number of client sites following an upgrade of their ARev application. I've tried to examine a number of possibilities including altered dictionary items, rogue MFSs and redundant/inefficient coding.
After quite a bit of feedback, the slowdown appears to based around the navigation and data entry in the windows and it seems to be almost all over the place i.e. it doesn't appear to be a specific validation routine a couple of windows.
Generally, the scenario is something like this:
- Enter a window and type in a record key, it will take maybe 5 seconds to load the record
- if I go back and enter in a new record key without exiting the window it takes about 1 second to load
- If I go back out of the window and enter in the second key that previously took just 1 second to load it now takes 5 seconds to load, just like the original
- Meaning if I enter a new window I will experience a delay on the first record entered, but not on subsequent entries. Exiting and reentering the window will reset the conditions
My thought was that maybe it was because the programs are not resident in memory on first entering the window and on subsequent records they are. If this sounds plausible or there are some other possible explanations, could someone please advise.
I know that what I've attempted to discuss is pretty vague and on most occasions we are talking of only seconds, but the slowdown is a fairly high order of magnitude.
TIA.
At 20 AUG 1999 05:43AM [email protected] onmouseover=window.status=why not click here to send me email?;return(true)", [url=http://www.sprezzatura.com" onMouseOver=window.status=Why not click here to visit our web site?';return(true)]Sprezzatura Group[/url] wrote:
What you describe is definitely a program cacheing problem. Cameron Purdy has previously posted a superb cacheing program to get around this. Further optimisation is possible as this REVMEDIA article pointed out…
The chief complaint received regarding window processing addresses its lack of speed. There are ways of optimising this performance but they require an understanding of the window flow control and unfortunately accurate documentation of this is not provided with the product. There are two areas to address when considering user complaints - perceived slowness and actual slowness.
Perceived Slowness
When the user presses F8 or F9 there is generally a delay of a second or so before the screen clears. The user is unsure whether the key has actually connected and tries again thus adding to the delay. If the screen were to clear immediately the key was pressed the user would be happy even if the delay between screens remained the same. This trick can be easily accomplished. All that is required is that an image of a blank screen be captured and redisplayed whenever the user presses F8 or F9, in other words on a PRE.READ. The most convenient place to store such an image is in one of the registers because these are automatically reset to default values when the window is invoked. Thus on a pre read the existence of the screen image could be tested for. If present, it could be displayed., if not it could be loaded. A suitable piece of code hung off a commuter program on a pre read would be
NB Any unused WC_REGISTER% could be usedIF WC_REGISTER% (3) THENCALL VIDEO.RW(0,0,79,23,"W",WC_REGISTER%(3))END ELSECALL VIDEO.RW(0,0,79,23,"R",WC_REGISTER%(3))ENDActual Slowness
The relative slowness of the window processor is caused by the amount of hooks into the applications generator provided by PAINT.. Extensive use of the SKELETON routine provided with the last utility diskette show that the program control flow for the window interpreter is as follows (assuming that no specific symbolic recalculation options have been set)
Window InvokedCall all PREAPP processesCall PRE.INIT processCall POST.INIT processCall PRE.READ processFor Each Prompt in WindowIf prompt has depth on screen (EG MVed)Call OCONV for each line (@MV=WC_MV% =")ElseCall OCONV for fieldNextPrompt for KeyCall Key DFLT processCall Key PRE processCall OCONV processCall REP.SCRIBE processCall EDIT processCall OCONV processCall POST processCall OCONV processCall PER.PROC processDisplay RecordCall PRE.READ processCall REP.READ processCall POST.READ processFor Each Prompt in WindowIf Prompt has depth on screenIf Prompt F TypeFor X=1 to DepthCall OCONV for each line (@MV=WC_MV% =")NextIf Prompt S TypeFor X=1 to DepthCalculate Symbolic (@MV=WC_MV%=X)NextCall POST Process (@MV=Depth WC_MV%=")For X=1 to DepthCall OCONV for each line (@MV=Depth WC_MV%=")NextElseIf Prompt F TypeCall OCONV processIf Prompt S TypeCalculate SymbolicCall POST processCall OCONV processNext PromptPrompt for FieldIf WC_IS%=" then Call DFLT processCall PRE processCall OCONV processCall REP.SCRIBE processCall EDIT/ICONV processCall OCONV processCall POST processCall OCONV processCall PER.PROC processFor Each S Type Prompt in WindowCalculate SymbolicCall POST SymbolicCall OCONV processNextPass through FieldIf WC_IS%=" then Call DFLT processCall PRE processCall OCONV processCall REP.SCRIBE processCall POST processCall OCONV processCall PER.PROC processPass through Symbolic (when previous real field changed)Calculate SymbolicCall POST processCall OCONV processCall PER.PROC processFor Each S Type Prompt in WindowCalculate SymbolicCall POST processCall OCONV processNextPass through Symbolic (when previous real field not changed)Calculate SymbolicCall POST processCall OCONV processCall PER.PROC processSave RecordCall EDIT process for filed being prompted for (if field changed)Call POST process for field being prompted forCall PER.PROC processCall PRE.SAVE processIf WC_OREC% # @RECORD thenCall REP.WRITECall POST.SAVELoad null@RECORD and @IDCall PRE.READ processCall OCONV process for all fieldsPress F8 KeyCall OCONV for field being prompted forCall PRE.READ processCall OCONV process for all fieldsDelete RecordCall PRE.DEL processCall REP.DEL processCall POST.DEL processCall OCONV process for all fieldsExit WindowCall POST.APP processStudying the above details may provide many interesting insights into the modus operandi of the window interpreter. It explains why the window takes so long to display first time around (it has to call all of the unit logic, calculate all the symbolics and all the OCONVs on a screen with a blank dummy record and finally perform the key default and pre logic). It further explains why saving a record takes so long (it has to call the edit and post logic for the field we are currently on, the associated wrapup logic, calculate all the symbolics and all the OCONVs on a screen with a blank dummy record and finally perform the key default and pre logic). An interesting point to note is that the only processes attached to a symbolic that work are POST and PERPETUAL.
All of this may seem like overkill but a little thought shows that RevTech are just being thorough, none of these stages could be omitted if ALL possible circumstances are to be accommodated. Fortunately the average programmer does not have to cope with ALL possible circumstances. The environment in which the program will be running is generally known ahead of time.
This being the case we can short cut several of the above time consuming steps by careful modification of the template structure "on-the-fly". It is very unlikely (in the majority of applications) that when a record is saved (and before the next key has been prompted for) it will be necessary to call the PRE.READ process and all of the OCONVs with a blank record. Thus these could be removed from the template at PRE.SAVE and restored at PRE.READ (if @ID was not set to null, otherwise it should not be restored as this is the "dummy run"). The code to achieve this can be made generic and just slotted into the appropriate places in a commuter program. For those not wishing to undertake this coding exercise, example code to achieve this function will be presented in the next issue of REVMEDIA. Under certain circumstances this can dramatically reduce the time taken for a screen to F9 or F8. Note though that the performance improvement is dependant upon the individual characteristics of the screen. Those most likely
to show improvement are those with OCONVs that XLATE to another file for a value and that have associated multivalues with user defined conversions.
(Volume 2, Issue 2, Pages 5-8)
World Leaders in all things RevSoft
At 20 AUG 1999 11:39AM Victor Engel wrote:
What the article describes is general window processing slowness. The original issue concerned slowness associated with a recent upgrade. It has been a few years, but I remember encountering this problem as well after upgrading from version 2.12 to 3.x. I don't know if we ever found the root cause of the problem, but repainting a screen resolved the problem.
At 21 AUG 1999 12:25PM [email protected] - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote:
If memory servers, repainting fixes the hidden label bug.
As for speed decreases moving to 3.12, it could be related to the window resolving the dot fields to underscores.
At 23 AUG 1999 10:40AM Victor Engel wrote:
] If memory servers
That's what I need .. a memory server ;) .
At 24 AUG 1999 11:41PM Giles Wycherley wrote:
Thanks for all the responses. I should be careful when I throw around the word "upgrade" - I really meant a programmatic upgrade not an ARev upgrade. Sorry, if I caused confusion.
The client I am talking about did undergo the "." to "_" conversion so maybe some slowness can be attributed to this recalculation. However, I have had reports from other clients also of slowness who have had this conversion done a long time ago and only now complain of slowness.
The slowness really seems to be loading the initial record in a window which sounds like the program cacheing problem. I'll check this out, I don't know if there is anything programmatic that we could have changed to cause this. We've at times actively tried to reduce the number of symbolics and xlates so I wouldn't have thought it was an increase of symbolic calculations.
Thanks, for shedding the light.