Lot's of unnecessary layouts and relayouts while scrolling

You must Login before you can answer or comment on any questions.

I've experienced some choppy tableview scrolling so I looked at the underling objective c code only to discover lot's of inefficient calls inside tiuiview doing unnecessary layouts and over complex things... does anyone working on optimizing and improving the code ??

I think that speed and performance should be a priority instead of features.

— asked 8 months ago by erez pilosof
2 Comments
  • For the first part, refer to Shannon's answer below. But I was just curious if there a reason that you believe that we don't feel the same way about speed and performance??

    — commented 8 months ago by Anthony Decena

  • It seems to be especially bad when using complex rows instead of the default leftImage, title, etc. properties. I'm glad to help contribute to a test case -- tableview performance essentially destroys the overal performance of my app despite every optimization I could come across. Might be good to start with tableviewlayout 2 in KitchenSink...

    — commented 8 months ago by Michael Belkin

2 Answers

I can actually vouch for the developers, that they have spent a ton of hours improving tableview scrolling.

If you see a way to improve it even more, then I suggest that either: 1. You go ahead and do it, and submit a pull request. This is an open-source project, after all 2. At least open up a JIRA ticket outlining the exact changes you'd make.

Contributing to Titanium

I have the highest respect for the effort of building titanium and love the project, this is the reason I started this conversation. todays apps are highly visual rows can be complex not just a title and image (see my app images). making the perceived performance of titanium look bad.

I know it's an open source project, sadly I have only basic objective-c knowledge and the codebase is becoming complex.

I realized the code is not tuned to performance after I defined every rowview with exact pixel dimensions so not lot's of layout calculations need to be made by appcelerator. and then I did a simple logging of things happaning while I scroll, for example I saw lot's (thousands !!) while scrolling to the relayout method of TiViewProxy.m even nothing changed on the view layout. also lot's of calls to TiLayoutQueue also most of the redundant. all those things are killing performance.

in order for appcelerator to strive it must have a performance edge on html5 and I think without focus on performance tuning (like 1.7 release focus on memory leaks) it won't get there.

I did a test on the same complex layout rendered as html and it achieved better scrolling results !!! then appcelerator.

— answered 8 months ago by erez pilosof
answer permalink
3 Comments
  • Perhaps you should share your code. I see plenty of apps out there with complex tableviewrows that scroll just fine, including mine.

    — commented 8 months ago by Shannon Hicks

  • as "Michael Belkin" just commented above simple trace on "tableviewlayout 2 in KitchenSink" shows the same issues of relayouts and recalculations.

    also happening on scrollview, im using 2.0.1 but I think the issue was not addressed on 2.1

    — commented 8 months ago by erez pilosof

  • Q&A is to help you with your problems. I don't have time to go and optimize the KS project, nor would it help solve your problem anyway.

    This ticket could be interesting to you, though: TIMOB-5429

    — commented 8 months ago by Shannon Hicks

Your Answer

Think you can help? Login to answer this question!