Tuesday, August 13, 2013

ZK Application Performance Boosting Tips

1-Handling Huge data:-Use Model and Paging
2-Turn on ROD(Rendered on Demand feature) loads only the necessary chunk from associaed ListModel,item are olny created and sent to client when visible,Boost performance client side as well as server side,Less memory usage on Client side and server side

3-Implement OWN ListModel,TreeModel
Extends from AbstractListModel,AbstractTreeModel
ListModel ,DefaultTreeModel assumes all data is available in memory,however it is not pragmatic to load data at once
By implemeting custom model you can load only segment of data required and progressively allocate/de-allocate data
This furthers server side optimization of handling huge data in addition to ROD
Defer Creation of Child Components
Do not create Components unless you need them

Defer the rendering of child widgets
do not create delay creating rendering components in case you still need them
unlike fulfill components are created immediately only the rendering is delayed
Just a UX trick but is effective

Minimize # of JS files to load
More # of JS files means more # of Get Request
Why ZK doesnt budle all in one by default?
Not all required
Make payload that much bigger even of Simple pages
User server side include for all and only load single load this single page like this
Load JS And CSS resources from server nearby
Close so loads faster
Main Server load can be reduced
HOST ZK static resource Server
Implement a Encodes.URLEncoder to serve the static resources JS & CSS from nearby Server
Use Stub only components to reduce the server memory footprint Why?
Each ZK Components has 2 Counterparts A widget, that represents it on browser side A Components , normally a Java Object instance, that holds component state Howe ever if you only need for layout of render particular info/data then you may not need it's Java object instance on server side
What about really truly huge data requirement?
Sometimes you just have to show hundreds of thousands of row/column data
and not use paging
ROD is not enough
For that Use BigListbox
Just Like any other data Component
Use compiled Java Code,No Zscript
Reuse Desktop
Use only for pages that takes longer to generate
You could also employ time based strategy
Use button mold "os"
Use lighter components where possible eb Hlayout/vlayout instead of hbox/vbox
Detach and reattach instead of visible="false"
Note:- This all data from ZK Training session from Zk Team

No comments:

Post a Comment