|
BulkTableRenderers
Bulk rendering tables: `TableBulkRenderer` and `PreloadedTable`
IntroductionFor those that need every last millisecond of speed for table manipulation, we have introduced table bulk renderers and PreloadedTable. A TableBulkRenderer will render all rows in a table at once. After being loaded, widgets, cell spans, row spans etc. may be added to the table, but there will be no speed advantage for them. A PreloadedTable is a simple FlexTable that allows programmers to use the familiar declarative API and still get some of the speed advantages from bulk rendering the contents of the table only after its been attached to the DOM. Here are some comparison numbers for a 120 X 15 row table.
|
Sign in to add a comment
Why not have a broader design -- something that would work out for every GWT widgets out there.
From day 1 that I heard about GWT, I was hoping for support for (what you call) "bulk" rendering -- something that could be part of every widget automagically. The page load speed improvement are simply radical! It is much faster to let the browser parse a string than calling the DOM to create elements.
Essentially, the fastest/flexible way I found to make HTML appear from javascript is by using the browser HTML parser engine (browsers are built to be ultra-fast HTML parsers) along with building a "string" using the array trick (to join it all at once at the end so there is less re-allocation internally) - something like:
var h = new Array();
hh.length? = "<img src='"; hh.length? = imghref; hh.length? = "'>";
renderSomethingElse(h, someParams);
var fragment = document.createElement('DIV'); fragment.innerHTML = h.join(''); //...insert the fragment into the DOM...
But how to have the ability to render any widget (the first time around only) using a similar technique? Maybe swap the "DOM" object for a bulk one? (then this object would potentially slow trying to emulate the DOM and generate a big string). The best would be to have a way to make the compiler (or some build tool) knowledgable in order to be able to pre-build static strings everywhere possible.
were are they?