Wydajnosc

Aktualnie tylko w angielskiej wersji.

PowerBuilder good programic practices :



Use static function calling convention instead of dynamic  functiosn. 
The dynamic calls are flexible but affect performance, additionaly the dynamic calls are not verified by compiler
that may lead to runtime errors. 
If you need call a function dynamically it is  better to declare virtual function in ancestor object and then call one 
from descendands.


If the variable does't change in application then declare them as  constants in none visual user object.
If your functions receives many  parameters like string, blob, date, etc. then pass ones as READ ONLY.
Passing parameters using READ ONLY pass value without making a copy of the data.

Use local variables for fast performance and avoid global variables. Take  scripts as short as possible for faster compilation.
If you reference objects using "dot" notation try decrease number of execution  checkin (look at example)
by using the DWObject object reference:

DWObject ldwo_dw
ldwo_dw. = dw_details.Object.v_first_name
ldw_dw.visible = 1
ldw_dw.background.Mode = 0
ldw_dw.x=12
ldw_dw.y=12

You can also modify DataWindow properties in one pass using DW.Modify function.


Modify garbage collection default interval (0.5 second). Use following funtion  to managing garbage collection:
GarbageCollect()
GarbageCollectGetTimeLimit()
GarbageCollectSetTimeLimit()
To verify when and frequency of the garbage collection mechanizm run trace and profiler (see the section )

TreeView -> don't populate all levels of the tree view. At startup populate only root and then use ItemPopulate
event to insert items in child branches.

Disable redrawing screen using SetRedraw(FALSE) in case a list or tree view  is populated

[Witamy] [Wydajnosc] [PB Tricks] [O mnie] [Galeria] [Kontakt] [Linki]