1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    hessius is on a distinguished road

      0  

    Default Answered: ST 2.2.0: Best list performance: infinite or not?

    Answered: ST 2.2.0: Best list performance: infinite or not?


    Hi

    I can't really wrap my head around the new infinite property introduced for the list component in sencha touch 2.2. As I had understood it, the infinite list was devised for improved performance, but I've also come across statements that setting infinite to false in 2.2 will in fact improve performance.

    So my question is this: which is better for performance, infinite: true or false?

  2. Depends on the size of the list.

    Infinite lists will have near identical performance regardless of the size of the list. You need to understand that with infinite lists, they only hold as many dom elements in the memory as they need to, to fill the height of the visible part of the list. When a scroll is done, they recycle the dom elements. So scrolling is always choppy, but performance is otherwise consistent.

    Set infinite to false, and every single item in the list will have a corresponding DOM element right from the start. Too many elements in the dom, and your whole app will massively suffer in performance. If the number of records in the list is relatively low, however, you'll get much better scrolling than an infinite list - because there's no need to do the work of recycling dom elements right in the middle of the scrolling. For a simple list you should be able to be non-infinite with around 200 or so items just fine. Of course, depends on the device, the complexity of the rest of the dom, and the complexity of each list item's dom.

    If in doubt, inspect the dom and see what's happening in both cases. Amazing how much you can learn by doing this!

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    484
    Answers
    24
    Vote Rating
    48
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      2  

    Default


    Depends on the size of the list.

    Infinite lists will have near identical performance regardless of the size of the list. You need to understand that with infinite lists, they only hold as many dom elements in the memory as they need to, to fill the height of the visible part of the list. When a scroll is done, they recycle the dom elements. So scrolling is always choppy, but performance is otherwise consistent.

    Set infinite to false, and every single item in the list will have a corresponding DOM element right from the start. Too many elements in the dom, and your whole app will massively suffer in performance. If the number of records in the list is relatively low, however, you'll get much better scrolling than an infinite list - because there's no need to do the work of recycling dom elements right in the middle of the scrolling. For a simple list you should be able to be non-infinite with around 200 or so items just fine. Of course, depends on the device, the complexity of the rest of the dom, and the complexity of each list item's dom.

    If in doubt, inspect the dom and see what's happening in both cases. Amazing how much you can learn by doing this!
    I blog about Sencha Touch at www.senchatouchdev.com

  4. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    hessius is on a distinguished road

      0  

    Default


    Thanks!

    My list contains roughly 2000 items, with what I think is not a complex list item DOM (though I have little to compare it to). Since the app basically is a list and not much more, scrolling performance is imperative to the UX.

    The list actually resides in a phonegap app and due to usage of some native technologies it won't run and thus can't be tested (or inspected) in a browser.

    Performance was already good on iOS but android was abysmal. Have tested with infinite false on my iOS units without noticing much of a difference. Haven't tested on android yet, I'll have to try to decide empirically I think.

    Thanks for explaining it to me.

    Oh, and if anyone wants to check the app out it's live on the AppStore

  5. #4
    Sencha User
    Join Date
    Jun 2012
    Location
    England
    Posts
    17
    Vote Rating
    0
    Lalrinfela is on a distinguished road

      0  

    Default


    One thing i have notice setting list with infinite is that if you perform search on that list (like the example list-search), the search results did not scroll to top.

    If you scroll like a few items down, perform search that you sure will give one or two results, the results remain hidden somewhere in the top.

    But if the infinite property to the list is false, this problem is not there. I am still finding a solution for this.

  6. #5
    Sencha User
    Join Date
    Jan 2013
    Posts
    10
    Vote Rating
    0
    hessius is on a distinguished road

      0  

    Default


    Adding a scrolling function to your searchfunction solves this issue
    Code:
                Ext.getCmp('MyList').getScrollable().getScroller().scrollTo(0,0);

  7. #6
    Sencha User
    Join Date
    Jun 2012
    Location
    England
    Posts
    17
    Vote Rating
    0
    Lalrinfela is on a distinguished road

      0  

    Default


    I have figure out this sometime later through other thread solution but Thanks anyway. I should have post the reply. Cheers!! :-)

  8. #7
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    484
    Answers
    24
    Vote Rating
    48
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    Infinite is still buggy for me, especially on native. It's completely gone from my apps again, until it's fixed. DataView's performance is much much better than a standard list.
    I blog about Sencha Touch at www.senchatouchdev.com

  9. #8
    Sencha User
    Join Date
    Jun 2012
    Location
    England
    Posts
    17
    Vote Rating
    0
    Lalrinfela is on a distinguished road

      0  

    Default


    List scrolling and searching is almost as fast and good as native in my app that i am working on. As my records grew like close to a 1000, the searching when infinite(true) is almost unuseable and sometimes even hang the app.

    However, my app as of now uses only around 200 records in live but i am expecting this to come close to 1000 soon and i hope future version of sencha solve this issue.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar