-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm trying to improve pages performance.
I have been reading the performance tips in ZK Developer's Reference and I would like to know if it's better using ZUL pages with native namespace or JSP pages with ZK JSP tags.
Or maybe is it the same?
Thanks in advance.
@beemsoft:
ZK-JSP is available for all projects which can be distributed under GPL:
http://www.zkoss.org/license/extension.dsp
Cheers, Maik
Also note that the ZK JSP tags are available for ZK EE only:
http://books.zkoss.org/wiki/ZK_Installation_Guide/ZK_Background/The_Content_of_ZK_Binary_Distribution
JSP is faster. It's a performancetip to replace "static" zul with jsp and use zul-filters only for zul-content.
How JSP works (exclude the zul-stuff)
JSP Source --> replaces variables add filter-content on serverside --> send the complete html-send --> browser shows the "ready" html-content (+ start javascript actions/content)
+ there is no serverside mirror for jsp components/content --> less memory on server
- there is no servside mirror for jsp/conent --> no access from the controller (i.e. make hidden for print, or get events for jsp components)
+ no (or less) screenbuilding by the client
- you have to handle 2 gui-languages (zul, jsp)
- jsp is limited
How ZUL works
ZUL creates a serverside mirror for all components on serverside --> sends a copy of the GUI to the Client-Enngine --> the client-engeine (inside the browser) creates also a GUI-tree (DOM) and render the output
- need more resources on both sides (server + client)
+ full java/zul mirror on serverside
++ full clientfeatures on serverside (events, attributes)
What's the best for you, depends to your needs.
I can only write my point-of-view:
* JSP could be an option, if you have heavily used sites with many static content and/or work page-orientate
* if you migrate an existing jsp-application to zul, it's also a nice option
* because development and maintenance speed is the most important point for us, we don't use jsp to keep it simple
* for some special cases we use client-code to improve the UI-feeling
* new applications looks more like desktop --> less page-orientate
* because my users are limited (intranet or registered customers) i have no headache about performance
to be more clear:
Our greatest applications are installed on modest serverhardware (M dualcore) and limited to 256MB Memory (because it's not alone).
However, it's no problem to handle over 100 concurrents users with this limited resources. We use ZK (3.6 + 5), Spring and Hibernate
via OpenJPA. I've monitored the tomcat with the NewRelic Tools - and response times are stable for this amount of users. Compared
to a Ruby on Rails Applications (also monitored by NewRelic Tools) - ZK needs less resources and have faster response times.
However, jsp is only for special cases. For fast development and easy maintainance i advise a zul-gui (as Maik wrote: without zscript)
and java for the controller and models.
/Robert
I want to know too. What is Faster JSP or ZUL?
Hi,
the biggest problem (regardless of using ZUL or JSP) is Java-Code interpreted by BeanShell... all Java-Code enclosed in <zscript>...</zscript> and all code in event-handlers like onClick="..." is interpreted by BeanShell which is really slow (compared to compiled Java Code).
So the best advice: use BeanShell for prototyping, but move all code to Java-classes when done.
Cheers, Maik
Asked: 2010-12-14 04:40:48 +0800
Seen: 682 times
Last updated: Dec 30 '10