Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26700] Windows: Optimize UI rendering calls

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-03-11T14:54:38.000+0000
Affected Version/sRelease 7.5.0
Fix Version/sRelease 8.0.0
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2019-01-08T01:09:47.000+0000
Updated2019-03-11T14:54:38.000+0000

Description

Optimize UI rendering calls in our layout engine.

Comments

  1. Kota Iguchi 2019-01-23

    https://github.com/appcelerator/titanium_mobile_windows/pull/1345
       Ti.Analytics.optedOut = true; // Just to make sure networking won't affect the test
       
       var win = Ti.UI.createWindow({ backgroundColor: 'green' });
       
       win.addEventListener('open', function () {
           var start = +new Date();
           for (var i = 0; i < 200; i++) {
               win.add(Ti.UI.createLabel({
                   width: 200, height: 50, left: i * 10, top: i * 10, backgroundColor: '#0000FF', text: 'Hello, World'
               }));
           }
       
           // setTimeout() effectively push tasks on UI thread.
           // This can be useful when you need to see actual UI response time.
           setTimeout(function () {
               alert((+new Date() - start) + ' m seconds elapsed');
           }, 0)
       });
       
       win.open(); 
       
    Locally, I've got average 20% improvement when compared to 7.5.0.GA. I also saw that Jenkins runs unit tests faster than before by 4 mins (10 % faster) which is a good sign too.
       

    7.5.0.GA

    1641 ms 1625 ms 1015 ms 1203 ms 1610 ms 1609 ms 1000 ms

    TIMOB-26700

    1328 ms 860 ms 1344 ms 1125 ms 1406 ms 1031 ms 890 ms
  2. Kota Iguchi 2019-03-08

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/1345 8_0_X: https://github.com/appcelerator/titanium_mobile_windows/pull/1364
  3. Kota Iguchi 2019-03-08

    Note that this will introduce major breaking change on binary compatibility on module interfaces which requires major version bump-up on module apiversion. _All modules needs to be recompiled based on new sdk._ TIMOB-26886 is taking care of apiversion in the sdk.
  4. Kota Iguchi 2019-03-08

    So far I can see good results on most practical app from customer (aka PerformanceTestApp). I can see up to 37% less application startup time and 45% less UI rendering time.
       7.5.0.GA
       
       [INFO]  Application startup in 1750 msec
       [WARN] [summary/contentView]  Total time to render UI:  2718
       
       8.0.x (with TIMOB-26700)
       [INFO]  Application startup in 1110 msec
       [WARN] [summary/contentView]  Total time to render UI:  1500
       
  5. Kota Iguchi 2019-03-09

    For additional note, I would strongly recommend consider disabling transpile flag in tiapp.xml when you concern runtime performance. We observed that enabling transpile slows down the app because it tend to add lots of files and operations in order to support ES6+.
     
       <transpile>false</transpile>
       
  6. Kota Iguchi 2019-03-09

    Merged.
  7. Josh Longton 2019-03-11

    *Verified as Fixed* The fix is present in SDK {noformat} 8.0.0.v20190308114556 {noformat} *ENV* {noformat} Noka lumia 550 (Win 10) Ws-emulator Windows 10 Pro: 1803 Appc NPM: 4.2.13 Appc CLI: 7.0.10-master.17 Ti CLI Ver: 5.1.1 Node Ver: 8.9.1 NPM Ver: 6.4.1 {noformat} *Closing ticket*

JSON Source