My favorites | Sign in
Google
                
Search
for
Updated Nov 26, 2007 by gwt.team.ecc
Labels: Type-Widget
BulkTableRenderers  
Bulk rendering tables: `TableBulkRenderer` and `PreloadedTable`

Introduction

For 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.

IE-Table Widget 1st run 2nd run 3rd run average milli
FlexTable 2125 1953 1844 1973
Grid 734 734 734 734
bulk rendered FlexTable 156 156 157 156
PreloadedTable 203 203 187 197

FireFox-Table Widget 1st run 2nd run 3rd run average milli
FlexTable 687 687 688 687
Grid 436 438 500 458
Bulk rendered FlexTable 78 172 78 111
PreloadedTable 125 219 219 187


Comment by bernard3000, Jan 24, 2008

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.

Comment by natasha.kuzmanoska, Dec 07 (3 days ago)

were are they?


Sign in to add a comment