Monday, 15 April 2013

javascript - Is the performance price of GWT operations with DOM elements really high? -



javascript - Is the performance price of GWT operations with DOM elements really high? -

what want understanding of performance cost pay dom operations made gwt. want know operations "expensive" , not, , how can measure it. know how can profile these operations, or may not worth pay attending issues @ all.

to more exact, here list of use-cases have encountered.

1) utilize case #1: have widget changes appearance if event ocurres. there difference if remove old widget , create new one, or improve alter style of existing widget? in other words, how big cost of creating , inserting new widget in gwt app? there kind of garbage collector removed dom elements?

2) utilize case #2: need or save info from/on server-side. info can quite big. there sense create special servlet create operation in simplified manner: accepting or printing string instead of making rpc phone call standart gwt servlet? way raise performance? self-written servlet can simple.

3) utilize case #3: have widget long list of other widgets. how can estimate number of widgets safe show client-side performance? mean if show 5 1000000 chat messages past 5 years client-side become slowed down, if load items part part, limiting server-side stress.

4) utilize case #4: performance cost of dom operations such finding out number of elements within container, or finding out style of element? example, need count number of messages in chat. operation of counting chat container's dom children expensive much improve implement separate counter , increment new messages arrive (just java collections do) ?

use case #1: updating style recommended rather remove/add widget. updating style means css parsing/recalculation/painting. remove/add widget lead dom & css parsing/recalculation/painting.

use case #2: depends on operation. gwt comes 3 flavors of server side communication. each of them suited different utilize cases - read here.

a) rpc - remote procedure calls b) rf - request mill & entities c) request builder self-written servlet serving strings,json or autobean.

use case #3: have gwt cell widgets display big info minimal dom operations. if displaying chat message requirement give celllist seek autopager on scroll , may throw in asynchronous dataprovider.

use case #4: supposed utilize java pojo backed cell widgets. each chat message instance of java pojo "chatmessage" , based on rpc phone call fetch list , feed celllist/celltable . why count dom when can count "data" sizeof of operation on list.

you thinking way ahead of project in wrong direction. dom operations concern if programming approach wrong. go through gwt samples downloading gwt files , execute them importing eclipse.

performance tuning strongest feature of gwt. given sufficient experience can tune out performance issues in gwt using speedtracer, logging, chrome dev tools profiling, gwt lite weight metrics, code splitting, gwt compiler metrics, gwt closure compiler, resource bundling , list goes on....

javascript performance gwt dom

No comments:

Post a Comment