Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Ajax slow downs large grid, what to do?

Ajax slow downs large grid, what to do?

Scheduled Pinned Locked Moved ASP.NET
questioncsshelp
13 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xenonysf
    wrote on last edited by
    #1

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

    N C R 3 Replies Last reply
    0
    • X xenonysf

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

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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.


      My Website | Ask smart questions

      X 1 Reply Last reply
      0
      • N N a v a n e e t h

        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.


        My Website | Ask smart questions

        X Offline
        X Offline
        xenonysf
        wrote on last edited by
        #3

        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.

        N 1 Reply Last reply
        0
        • X xenonysf

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

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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 )

          X 1 Reply Last reply
          0
          • C Christian Graus

            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 )

            X Offline
            X Offline
            xenonysf
            wrote on last edited by
            #5

            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?

            C 1 Reply Last reply
            0
            • X xenonysf

              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?

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              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 )

              X 1 Reply Last reply
              0
              • C Christian Graus

                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 )

                X Offline
                X Offline
                xenonysf
                wrote on last edited by
                #7

                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

                C 1 Reply Last reply
                0
                • X xenonysf

                  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

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  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 )

                  X 1 Reply Last reply
                  0
                  • C Christian Graus

                    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 )

                    X Offline
                    X Offline
                    xenonysf
                    wrote on last edited by
                    #9

                    thats for sure just like i did; i tried many ways and come up with the exact source of problem after inspecting every block and tier of the application. one more thing that i found out;

                    1 Reply Last reply
                    0
                    • X xenonysf

                      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.

                      N Offline
                      N Offline
                      N a v a n e e t h
                      wrote on last edited by
                      #10

                      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 ?


                      My Website | Ask smart questions

                      1 Reply Last reply
                      0
                      • X xenonysf

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

                        R Offline
                        R Offline
                        Rama Krishna Vavilala
                        wrote on last edited by
                        #11

                        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 drop

                        Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(sender, e) {
                        var gv = $get("GridView1");
                        gv.parentNode.removeNode(gv);
                        });

                        </script>

                        N 1 Reply Last reply
                        0
                        • R Rama Krishna Vavilala

                          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 drop

                          Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(function(sender, e) {
                          var gv = $get("GridView1");
                          gv.parentNode.removeNode(gv);
                          });

                          </script>

                          N Offline
                          N Offline
                          N a v a n e e t h
                          wrote on last edited by
                          #12

                          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 ?


                          My Website | Ask smart questions

                          X 1 Reply Last reply
                          0
                          • N N a v a n e e t h

                            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 ?


                            My Website | Ask smart questions

                            X Offline
                            X Offline
                            xenonysf
                            wrote on last edited by
                            #13

                            i couldn't make it work... But i guess it seems grid is deleting itself :^)? I'll try to make it work first then we'll see what will happen... So far I couldn't for my own reasons...

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups