create() slower in Enyo 2.3?

I've upgraded a fairly complicated app to Enyo 2.3 rc2 and noticed that some dynamic creation of Components is now much slower than in previous versions of Enyo. Is this a known issue or any obvious places to go looking to improve performace for creation of components?


I have two lists of ~20-30 controls each, that are created dynamically. When I select a menu item, the view and its lists are created and this now takes much longer to create than previously with Enyo 2.2. The length of time seems to increase linearly with the number of controls I generate.

On a top end handset - HTC One or Galaxy S4, this can take 1-2 seconds to generate the view, and I am seeing times like 40-80ms for the create() call for each control. Performance on a desktop is acceptable, but on a phone, not so much.

Inserting the list is done by generating an array of json objects and passing it to createControls, and then calling render after both lists are done:
    // .. generate array of json objects as componentsa and componentsb

    // then destroy, create, and render:
    this.$.lista.destroyClientControls();
    this.$.lista.createComponents(componentsa, { owner: this });
    this.$.listb.destroyClientControls();
    this.$.listb.createComponents(componentsb, { owner: this });

    this.render();
This repros on both Android 4.3 with the old Browser "WebView" in PhoneGap 3.2 and then new Android 4.4 with Chrome 30 WebView in PhoneGap 3.2 - so the new Chrome is slow too.

Generating this on demand is just too slow to respond to a tap on a phone. I could just take the hit on app startup and not load this view on demand, but I'd previously made this a lazy process to reduce DOM complexity to increase performance across the app.

Inheritance is a few levels deep, List includes 20-30 ListItemsTypes -> ListItem -> MyControl -> Control. And each ListItem is an image with 5 text nodes. When I've replaced this with just a basic Control with a single text node is is much faster.

I am not using Lists or Repeaters, just a Scroller with components, because I have a limited number of list items and I need additional items to indicate grouping.

Pointers on where to go looking for what got slow and where to speed this up, and why it might be slower now in Enyo 2.3?

Comments

  • Yes, creating components is slower in 2.3, but it shouldn't be that much slower. We had some real performance problems back around our pre.9 milestone, but we were able to do a lot of tuning and deferral of processing to get it back to the 2.2.0 levels in our internal tests.

    Just as a reference, I'm seeing creating/destroying 10,000 enyo.Controls to take around 533 ms in current 2.3.0-rc3. in Chrome 32 on my Windows desktop. On a Surface RT running IE11, I get 3780 ms (less than 1ms per control).

    We'd love some profiling here... our own internal tests have mostly been in desktop Chrome and in the target device WebKit we've been working with. It would be good to have some representative tests of your use case too, since it might not match our own. Specifically, I wonder if something in the nested control case is triggering a slow path, maybe in the new mixin code or the observables system.
Sign In or Register to comment.