Does GWT UiBinder really improve application performance?

I read the answer 2 years ago about the performance of UiBinder https://stackoverflow.com/a/4646262/212632 and I decided to check it out.

I built a very complex layout with many buttons and panels inside one another. version 1 had a layout built exclusively in UiBinder xml, and version 2 was purely software.

I deployed both versions to App Engine and ran both versions, clearing the browser cache before each launch. Version 1 (UiBinder) was loaded after ~ 12 seconds , and Version 2 after ~ 3 seconds , so it really discouraged me using UiBinder. Did you have different experiences?

+6
source share
2 answers

It seems to me intuitively that UiBinder-Code can lead to longer startup times. that's why:

Imagine you are trying to define 20 buttons in your view. In your declarative layout, you will declare each button explicitly, while in your imperative layout, you are most likely to use a for-loop. This will likely result in a smaller JS size for the imperative layout.

We also consider that in real applications this difference may be insignificant, since representations are usually the smallest part of a project.

The UiBinder documentation seems to be saying that this is more about runtime performance, so if you're interested in reducing load times, I suggest you look at
Code separation
HTML5 Appcache
and general performance recommendations (although a bit outdated, still very useful!)

Thanks for this question, I was looking for an extensive set of test tests for GWT functions (for example, UiBinder), but came empty.

+1
source

UiBinder, like any GWT generator, generates Java code. So, first read what is generated and comparable to what you write manually (pass the -gen parameter to the GWT or DevMode compiler so that it writes the generated code to disk).

Where UiBinder shines with HTMLPanel and I18N because it makes the code more readable than when writing in Java.

GWT 2.5 also introduces IsRenderable and RenderablePanel as an experimental feature, which, however, can enhance your performances under certain conditions (they did this to enhance Orkut punching). Again, UiBinder makes it easier to use ( IsRenderable otherwise requires calling its methods in the appropriate order and at the appropriate time for maximum performance; UiBinder makes this transparent). Unfortunately, there are no other IsRenderable widgets than the RenderablePanel , so this only helps if you create your own widgets that implement IsRenderable ; and IsRenderable runs at a very low level.

Generally speaking, UiBinder should not run slower than handwritten code (for an equivalent layout of widgets, of course). When people say that UiBinder works better (outside of IsRenderable ), it is that it recommends using an HTMLPanel instead of panels for layout. For example, an HTMLPanel containing an HTML <table> or a set of <div> runs faster than a FlexTable or a FlowPanel (assuming you don't need to dynamically change the layout).

+2
source

Source: https://habr.com/ru/post/927924/


All Articles