[Dojo-interest] dgrid ~30x faster than gridx?

Kenneth G. Franqueiro kgf at dojotoolkit.org
Thu Jan 16 19:51:06 EST 2014

I'm not too familiar with gridx but I am wondering if you need to
perhaps opt in to an additional module to get appropriate lazy
rendering/loading.  dgrid/OnDemandGrid (which I assume you're using)
already does this so when you refresh you are only testing the speed of
rendering about 25 or 50 rows.


On 1/16/2014 10:31 AM, cforgeron wrote:
> Hello,
>  First, thanks to all who spend their time on Dojo, I don't want my first
> post here to seem like an ungrateful complaint. 
>  As I'm working on my first Dojo prototype for a Web UI, I've used both
> dgrid and gridx. 
>  Research showed them to be similar, so I tried them both, and took a liking
> to gridx over dgrid, until I started loading significant data into it.  When
> I was dealing with only 700 rows of data, the time to render gridx was
> noticeable. 
>  To make sure I was doing things correctly, I wrote a separate test page to
> load gridx into one splitpane, and dgrid into another, sourcing both from
> the same local (not server side) memory store, using the same structure. 
>  Here is how I create the grids:
>         var gridx_grid = new GridX({
>             //cacheClass: cacheClass,  // Tried with it on, off, set to
> Async, set to Sync
>             store: rbr.center_tab[callback_tab].grid_data_store,
>             height: 400,
>             width: 200,
>             structure: shared_grid_structure
>           });
>         var dgrid_grid = new Grid({
>             name: 'dgrid',
>             id: 'dgrid',
>             columns: shared_grid_structure,
>             store: rbr.center_tab[callback_tab].grid_data_store,
>             noDataMessage: 'No Data Loaded',
>             loadingMessage:'Loading Data...'
>         });
>  I then coded a few buttons to use performance.now() to capture run times of
> the refresh functions for each. This is how I refreshed the grids:
>    dgrid_grid.set("store", rbr.center_tab[callback_tab].grid_data_store );
>    dgrid_grid.refresh();
> and
>    gridx_grid.model.setStore(rbr.center_tab[center_tab_id].grid_data_store);
>    gridx_grid.body.refresh();
>  Multiple runs give me a approx average of 1600ms for a gridx
> refresh/render, and 50ms for a dgrid refresh/render
>  I know gridx has a model that abstracts the store data, and I expect I'll
> have to pay some price for that abstraction, but 30x seems a bit high. 
>  I could write up a independent code sample to run this test - right now
> it's working on my test data which I can't share. First I wanted to see if
> anyone else is noticing this problem, or has any suggestions on where I
> could even the playing field. 
>  I'm using /dojo/gridx/resources/claro/Gridx.css as the default .css for
> gridx, and dojo in general  is using the standard
> /dojo/dijit/themes/claro/claro.css
>  Both dgrid and gridx were downloaded this week from the master branches
> from github. 
>  Thanks for your input. 
> --
> View this message in context: http://dojo-toolkit.33424.n3.nabble.com/dgrid-30x-faster-than-gridx-tp4000735.html
> Sent from the Dojo Toolkit mailing list archive at Nabble.com.
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Dojo-interest at mail.dojotoolkit.org
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

More information about the Dojo-interest mailing list