Ajax slow downs large grid, what to do?
-
I have a grid on my page and i am using ajax. Grid displays just 8 rows of thousands of records, i use a paging mechanism. I realized that it is so slow at displaying records. I traced the fetch time of my connection and find out that it is enough fast. But i realized that my browser hangs up for a while (like 10 secs) and thats why i though that data is coming slow, but ajax was the problem since i saw that everything is OK without an updatepanel. The question is how can I make my page rendered or processed or x? inside browser faster without disabling ajax in the page. (datas in my grid aren't that large, viewstate is at most 1kb maybe i mean it is not large either.)
-
I have a grid on my page and i am using ajax. Grid displays just 8 rows of thousands of records, i use a paging mechanism. I realized that it is so slow at displaying records. I traced the fetch time of my connection and find out that it is enough fast. But i realized that my browser hangs up for a while (like 10 secs) and thats why i though that data is coming slow, but ajax was the problem since i saw that everything is OK without an updatepanel. The question is how can I make my page rendered or processed or x? inside browser faster without disabling ajax in the page. (datas in my grid aren't that large, viewstate is at most 1kb maybe i mean it is not large either.)
xenonysf wrote:
i use a paging mechanism
Is this happens when you page through the records ? or it happened at the first load ? Usually DataGrid/GridView loads whole data and filter it for the specified page size and page number. So if you have to page through very large data, better choose custom paging.
-
xenonysf wrote:
i use a paging mechanism
Is this happens when you page through the records ? or it happened at the first load ? Usually DataGrid/GridView loads whole data and filter it for the specified page size and page number. So if you have to page through very large data, better choose custom paging.
-
I have a grid on my page and i am using ajax. Grid displays just 8 rows of thousands of records, i use a paging mechanism. I realized that it is so slow at displaying records. I traced the fetch time of my connection and find out that it is enough fast. But i realized that my browser hangs up for a while (like 10 secs) and thats why i though that data is coming slow, but ajax was the problem since i saw that everything is OK without an updatepanel. The question is how can I make my page rendered or processed or x? inside browser faster without disabling ajax in the page. (datas in my grid aren't that large, viewstate is at most 1kb maybe i mean it is not large either.)
Are you using AJAX, or using the Microsoft ASP.NET AJAX library ? When I looked at hte Microsoft library, it seemed to me like it was quite expensive to use, in terms of CPU time.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Are you using AJAX, or using the Microsoft ASP.NET AJAX library ? When I looked at hte Microsoft library, it seemed to me like it was quite expensive to use, in terms of CPU time.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Microsoft Ajax Library & Toolkit.. By the way i realized that my views state is almost 10Kb and my page is 70Kb :( ... Yes i think it takes to much time to process the data, actually i am not sure what the exact problem do you have any idea where i should inspect?
-
Microsoft Ajax Library & Toolkit.. By the way i realized that my views state is almost 10Kb and my page is 70Kb :( ... Yes i think it takes to much time to process the data, actually i am not sure what the exact problem do you have any idea where i should inspect?
I'd buy a good book on the ASP.NET AJAX library, and work out how to customise it so you have greater control over what it does. There's a good book from Manning on the topic.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I'd buy a good book on the ASP.NET AJAX library, and work out how to customise it so you have greater control over what it does. There's a good book from Manning on the topic.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
thnx but at the moment it is not a solution. Also i good at looking at references and see whats going on. I thought that this might be a common problem and somebody must know how to optimize
Yeah, perhaps you can find some help with google. I'm sure that others who have taken this approach have done a proof of concept first, found the problem, and taken the time to find a solution.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Yeah, perhaps you can find some help with google. I'm sure that others who have taken this approach have done a proof of concept first, found the problem, and taken the time to find a solution.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
No it does not happen for the first load actually. It gets slower when go further pages. But my query only returns records belongs to that page. I have a custom paging solution and it takes pagesize and pagenumber as parameter and just works fine.
Then your solution looks fine. I had a similar grid which I used to page through millions of records. It works just fine without any performance impact. Have looked task manager performance monitor ? Is this making any problem in firefox ?
-
I have a grid on my page and i am using ajax. Grid displays just 8 rows of thousands of records, i use a paging mechanism. I realized that it is so slow at displaying records. I traced the fetch time of my connection and find out that it is enough fast. But i realized that my browser hangs up for a while (like 10 secs) and thats why i though that data is coming slow, but ajax was the problem since i saw that everything is OK without an updatepanel. The question is how can I make my page rendered or processed or x? inside browser faster without disabling ajax in the page. (datas in my grid aren't that large, viewstate is at most 1kb maybe i mean it is not large either.)
Yes, it is a known issue. I answered this question in detail here: http://forums.asp.net/t/1065004.aspx?PageIndex=1[^] Basically you have to add the following script block:
<script type="text/javascript">
//Comment the following JavaScript code and you will see a huge
//performance dropSys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(sender, e) {
var gv = $get("GridView1");
gv.parentNode.removeNode(gv);
});</script>
-
Yes, it is a known issue. I answered this question in detail here: http://forums.asp.net/t/1065004.aspx?PageIndex=1[^] Basically you have to add the following script block:
<script type="text/javascript">
//Comment the following JavaScript code and you will see a huge
//performance dropSys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(sender, e) {
var gv = $get("GridView1");
gv.parentNode.removeNode(gv);
});</script>
Rama Krishna Vavilala wrote:
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(sender, e) { var gv = $get("GridView1"); gv.parentNode.removeNode(gv);
It's great. By the way what it means ?
-
Rama Krishna Vavilala wrote:
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(sender, e) { var gv = $get("GridView1"); gv.parentNode.removeNode(gv);
It's great. By the way what it means ?