Results 1 to 3 of 3

Thread: Optimization killers

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Vote Rating

    Default 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?
    Ext.define('Ext.button.Button', {
        initComponent: function() {
            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:

    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:, a, b);
    When this kind of optimization is possible it is a huge win for performance, since call takes the cake for speed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts