View Full Version: Painting A Program

LawsonTalk > Coding, Program Errors and Bugs > Painting A Program


Title: Painting A Program
Description: run time


melclan - March 28, 2006 08:22 PM (GMT)
When I paint a 4/gl program and execute it runs in seconds. When I generate 4/GL program and compile it, the execution time is much longer, what am I doing wrong :nix:

Milo - April 3, 2006 06:02 PM (GMT)
My 2-cents'-worth: When a program is compiled, a huge amount of COBOL code is appended in front of all of the COBOL that the 4GL screen painter created for you. This, combined with multiple referenced libraries, are all included in the .gnt file. Add to that the extra rules overhead that a LID or Portal session also includes, above and beyond the COBOL, and you have a long wait to start a "compiled" screen.

Programs persist in memory, based on a config file setting. See programs sitting in memory by using the 'tmmon' utility. There is a utility that pre-loads a program into memory. I tested this by pre-loading HR11, then timed HR11's load time. Not a significant difference. I didn't use a stopwatch, but it wasn't much, on the order of maybe 10%-20% faster. Using LID is pretty much the fastest way to bring up a screen, but it still takes 5 - 10 seconds for us to bring up HR11. So the delay is most likely based on Windows and LID stuff, like loading screen and object rules, user authentication, and so on.

melclan - April 4, 2006 02:42 PM (GMT)
QUOTE (melclan @ Mar 28 2006, 12:22 PM)
When I paint a 4/gl program and execute it runs in seconds. When I generate 4/GL program and compile it, the execution time is much longer, what am I doing wrong :nix:

Sorry I misled you, we are painting a batch report.

Thanks

trezaei - April 4, 2006 05:54 PM (GMT)
What are the program def parameters? Do a pgmdef on your program and F6,A for the definition and copy and past the params here. Have you set it to what all the other Lawson programs are set to?
Which compile program are you using? qcompile? loccmp?

Another thing to consider, when you run the program in paint is it retrieving the entire data set as when you run it as a compiled program?

tghost - April 4, 2006 07:11 PM (GMT)
Hi all,

There is a very major thing to consider when painting a batch program. When you paint a batch program you should not consider the painting itself to be the end of the program creation. The first thing I do after painting a program is to review the program code generated; in particular I look at the index usage, and apply some more advanced processing logic to the program. Especially take a look at the way the program is retrieving data and remember that the program generation piece was created before things like range processing or index filtering were enabled in Lawson, so those types of things are not part of the code generated during the painting process. Be especially aware that if the program does an internal sort, the access index in the 1000-SEL logic will not always be the most efficient index that the program could use. You can generally improve the performance characteristics of a painted program in a major way by doing a little constructive modification after the paint process is complete.

Happy coding all,
Ted

Milo - April 6, 2006 02:10 PM (GMT)
Ted, you're absolutely right. Come to think of it, I've tweaked every 4GL-generated report I every made. The 4GL way of running reports is a good starting point, but as you said, it can always be improved "in a major way".

Pramodchandra - August 7, 2006 05:23 AM (GMT)
when you compile a program , as said earlier it adds lots of cobol code, so look out for the things that are taking time EXAMPLE - FINDNLT is usually added by lawson compiler but as we all know when u dont have set of data then use of BEGRNG or USE of filter is fast

~Good Luck~
--------------------
Pramod
Their Code always work but not mine even if it is Copied :banghead:



Hosted for free by InvisionFree