zk vs gwt zk too many requests

2019-07-04 07:42发布

问题:

Hi I am trying to compare the performance of zk and gwt.

In my comparision I cant write any javascript by myself if the framework itself converts some code into js its ok(like gwt) but I cant write js by myself

On writing code in the above way for almost anything done on browser a request is sent to the server in ZK.

Hence eventually if you compare the no of request sent by zk to server is too high as compared to gwt.

i would like to ask the following.

  1. whose performance is better zk or gwt while ignoring the above.
  2. if we dont ignore the above then is my conclusion that gwts performance is better than zk right ?

I know that there might be other parameters when comparing performance... but if the difference between requests are so high i cant really see zk beating gwt which some people have said on some forums

pls help thanks

回答1:

The previous posts are basiclly, but there are some features in zk that,I think, must be talked about.
Remember, every request is a zk-event, cos zk is completely event-based.

  1. Client-Side Event-Handling
    Zk allows you to implement client-side event-handling just as well as server-side, which includes preventing zk from firing an event to the server.
    You can simple manipulate the client objects in js as you can do it in Java on the server-side
    or just do some post processing and and then...

  2. Use Client-Side Event-Firing
    Zk got that usefull js method zAu.send(zk.Event,int) that let's you send custom or standart events to the server.
  3. Deferrable Event-Listeners
    Deferrable-events are queued at client-side, so you can minimize the number of requests.
  4. Stubonly
    Stubonly is a way to make a component client-side only. But by now this is only available for zk EE.

So, you can see, if you like, you can limit the requests to maybe the same amount of requests of GWT.
If it make sense or not depandce on you/your applycation. But I think you can say that zk is more powerfull than GWT.
You maybe interested in iZUML and defer rendering too.



回答2:

GWT and ZK are very different architecturally. GWT is client-centric so it sends less requests to the server. With GWT you can basically control everything by yourself. This on the otherhand means, the developer is responsible for handling server requests and asynchornouse data transfer between server and client. If you are an experienced web developer then the result could be great. If you are not then it could be pretty challenging and complex as there are some network and security issues you need to take care.

On the other hand, ZK is server-centric, it handles these server-client async communication for you. With ZK developers can focus more on the business logic without taking care of client-server issues. As the framework takes care of client-server talk, there are more requests by default. If you wish to minimize the request, you can probably follow their developer's guide to do some tuning.

IMO ZK and GWT are both matured framework. You can probably think about your project requirements and your experiences in Web development then choose the solution.



回答3:

ZK is server side focused, since GWT is all in the browser, so ZK needs much more ajax hits to the server to get js fragments, screen portions, etc. whereas GWT just hit the server at the beginning to download the js app (which will be cached in the client for ever) and whenever the app needs some data from the backend.

Said that, IMHO GWT should perform better since you dont need any sort of view logic being executed in the server (lighter servers), and there are less requests in the wire.



回答4:

GWT and ZK are kind of different.

I've done some ZK projects and also some GWT projects. I didn't have performance issues in either cases,but I feel I need to write more code when I use GWT.



回答5:

My experience from real world projects with two teams, one writing using the zk framework and the second using GWT. Identical UI projects having data served from the same data service layer. The zk team completed the project in one third of the time the GWT team consumed. Both projects deployed in production. Users were happy using either app. Finally we kept the zk version in production. Why? Simply because the maintenance of the zk app was so much faster and simple compared to GWT! Sorry GWT... Nice technology backed up by a giant but we will keep going with zk.