PDA

View Full Version : Optimization of loadData method.



biohazardo
4 Jul 2012, 10:34 PM
I have some data in array (23000 records). I need to load it into store. I test performance in virtual machine.

Chrome do loading for 4 seconds, IE8 for 200! seconds. I've suspended events on this store. What can I do to optimize this part of application. (IE drops annoying errors about long running script)..




Wtb.getPlanShiftStore().suspendEvents(false);
Wtb.getPlanShiftStore().loadData(data);
Wtb.getPlanShiftStore().resumeEvents();


Maybe there is some another method, that will do it faster, or I need to override something? I just need to create models and put it into store's data... Or it's impossible...?

scottmartin
5 Jul 2012, 1:16 PM
This this store tied to a grid? or are you just populating the store ..

Scott.

biohazardo
5 Jul 2012, 10:37 PM
I have an MVC application. Viewport is created after all data generation and loading. When the store is loading, grid isn't exist yet.

scottmartin
17 Jul 2012, 5:38 PM
In researching this .. the simple truth is that <=1E8 is very slow in these matters. As you can see but the difference, the browser is the difference. Have you tried IE9 to see if the speed is any better?

Scott.

biohazardo
17 Jul 2012, 10:37 PM
Have you tried IE9 to see if the speed is any better?
Scott.
I tried. I don't have problems with IE9, it's fast.

IE8 throws annoying errors abount "long running script". I solved this way:
I have sleep method on server (100 ms). And I load my story by parts (3000 records), and then I do sleep. IE stops to throw errors in that case.

vadimv
17 Jul 2012, 10:41 PM
I have some data in array (23000 records). I need to load it into store.


Why you need them all 23000 ? obviously that will be some performance issues, why you just don't use pagination and load saying 400 records, less or more, or why not to use a buffered grid !!!?

biohazardo
17 Jul 2012, 11:43 PM
Why you need them all 23000 ? obviously that will be some performance issues, why you just don't use pagination and load saying 400 records, less or more, or why not to use a buffered grid !!!?

I need them all for counting. I defined new type of grid, that will create pages ( analog of paging grid, buffered grid works bad with 80 columns and renderers). But my store NEED ALL of records. I need to keep all of them on client, I can't load parts from server. That records are generated on client, and they need to be here.

And it's not just simple grid, it's scheduler, and there are 23000 events.

vadimv
18 Jul 2012, 2:47 AM
hmm....don't know, still didn't get why you need all records on client, your explanation is a little confusing to me.... I have buffered grid on an app whit thousands of records, and no problems regarding rendering or loading time.....BUT 80 columns !!!!! and so many events, you sth thinking wrong there or could be that your general approach to the requirement is wrong.
For what counting ? you need their total number or what ?

And btw or buffered grid or paging toolbar is almost the same, just user actions are different : with the former you page through records with the scroller, second with clicking on buttons, but both are working with pages at store level.

biohazardo
18 Jul 2012, 2:52 AM
And btw or buffered grid or paging toolbar is almost the same, just user actions are different : with the former you page through records with the scroller, second with clicking on buttons, but both are working with pages at store level.

When user click button, he can wait loading of view. When he scroll, he don't want to see laggy scrolling, jumping summary e.t.c

scottmartin
18 Jul 2012, 5:58 AM
I think the issue here is IE8, correct? It works fine in all other version browsers ..
To answer your question ... there is no magic setting to fix IE8.

Scott.

biohazardo
18 Jul 2012, 6:01 AM
I think the issue here is IE8, correct? It works fine in all other version browsers ..
To answer your question ... there is no magic setting to fix IE8.
Scott.
When I optimized my application for IE8, I understood, that there is no magic for IE8... I did everything, that is possible. I think, there is no fix for that problem... IE8 is IE8...

biohazardo
18 Jul 2012, 6:03 AM
.....BUT 80 columns !!!!!

Some info and two columns for one day in month (total 31, fact and plan value for each day). It isn't so rare case

Tim Toady
18 Jul 2012, 6:21 AM
23k of records on an 80 column grid without any type of pagination/buffering that creates "laggy scrolling" is not a reasonable requirement. Especially when you are targeting multiple platforms. Requirements are easy to make, but it doesn't matter if it can't be implemented. You need to rethink how you are architecting the application. A user can only see and understand a tiny fraction of that amount of data. If you need to do calculations for it, do it serverside and send back what is relevant to the user.

el_chief
18 Jul 2012, 10:55 AM
I am suspicious as to whether you truly need that much data on the client.

Why don't you count it on the server?

scottmartin
18 Jul 2012, 11:21 AM
Play nice ;)

Scott.

el_chief
18 Jul 2012, 11:49 AM
Play nice ;)

Scott.

You got me :) I need more coffee today apparently. Response edited.

Thanks for all your good work Scott