1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,308
    Answers
    13
    Vote Rating
    109
    LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light

      0  

    Default Answered: Optimization killers

    Answered: Optimization killers


    See this document in particular these two sections:

    3. Managing arguments, and
    5. For-in

    I see many places in the Ext JS code base where the arguments object is passed where it doesn't need to be passed.

    This article states "The arguments object must not be passed or leaked anywhere."...

    Do you think this code could be optimized?
    Code:
    Ext.define('Ext.button.Button', {
        ...
        initComponent: function() {
            ...
            me.callParent(arguments);
            me.callParent(); // <-- Use this instead?
            ...

  2. In the case of the Button initComponent method you are correct - it is wasteful to pass arguments, when the initComponent method has no arguments. We try to watch out for this internally but ocassionally one slips through the cracks, Thanks for pointing it out, we'll get it fixed.

    In v5 we are incrementally moving more toward this pattern:

    Code:
    foo: function(a, b) {
        this.callParent([a, b]);
    }
    Using an array will allow Sencha Cmd to optimize the callParent call and turn it into something that looks more like this:

    Code:
        this.superclass.foo.call(this, a, b);
    When this kind of optimization is possible it is a huge win for performance, since call takes the cake for speed http://jsperf.com/passing-arguments

  3. #2
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,308
    Answers
    13
    Vote Rating
    109
    LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light

      0  

    Default


    Do you think the "argument leaking" anti-pattern will stop optimization and should Ext JS code be updated?

  4. #3
    Sencha - Ext JS Dev Team Phil Guerrant's Avatar
    Join Date
    May 2011
    Location
    Colorado
    Posts
    274
    Answers
    24
    Vote Rating
    77
    Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice Phil Guerrant is just really nice

      2  

    Default


    In the case of the Button initComponent method you are correct - it is wasteful to pass arguments, when the initComponent method has no arguments. We try to watch out for this internally but ocassionally one slips through the cracks, Thanks for pointing it out, we'll get it fixed.

    In v5 we are incrementally moving more toward this pattern:

    Code:
    foo: function(a, b) {
        this.callParent([a, b]);
    }
    Using an array will allow Sencha Cmd to optimize the callParent call and turn it into something that looks more like this:

    Code:
        this.superclass.foo.call(this, a, b);
    When this kind of optimization is possible it is a huge win for performance, since call takes the cake for speed http://jsperf.com/passing-arguments
    Phil Guerrant
    Ext JS - Development Team

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi