Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6250 in a recent build.
  1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,308
    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 Delegate Ext.Object.chain to Object.create

    Delegate Ext.Object.chain to Object.create


    This is a performance improvement suggestion.

    Ext.Object.chain could be delegated (on supported platforms) to Object.create. This would improve performance.

    Object.create
    Ext.Object.chain

    Try this test. You will see that Object.create is at least 50% faster.

    EDIT
    Also, see this similar delegation Ext.Object.getKeys --> Object.keys


    Code:
    var obj = {
        key1: 'xxx',
        key2: 'yyy',
        key3: 'zzz',
        key4: 'www',
        key5: 'aaa'    
    }
    
    console.time('chain');
    for (var i=0; i<10000; i++) {
        Ext.Object.chain(obj);
    }
    console.timeEnd('chain');
    
    console.time('create');
    for (var i=0; i<10000; i++) {
        Object.create(obj);
    }
    console.timeEnd('create');
    *** EDIT 5/18/12
    See how the Compose library checks if Object.create is available.
    Last edited by LesJ; 18 May 2012 at 5:49 AM. Reason: Add Compose link

  2. #2
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,308
    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


    Hello, I hope we are paying attention to performance improvement suggestions in this forum.

    This simple and effective change will speed up object composition in Ext JS. This will make a difference in an application where you have thousands of objects (e.g. drawing applications).

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,335
    Vote Rating
    129
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Definitely listening. The gains will be proportional to the number of calls to Ext.Object.chain which is few since we don't use it many cases. The change is still a good suggestion though and makes perfect sense.

    You could hook Ext.Object.chain and count the calls to see if I am correct on that
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  4. #4
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,308
    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


    Quote Originally Posted by dongryphon View Post
    You could hook Ext.Object.chain and count the calls to see if I am correct on that
    The count is 968 times when my application starts. I'm not sure if this number is small or not so small, but thank you for listening

    EDIT
    847 - when this page loads
    http://localhost/wag/js/extjs-4.1.0/examples/index.html

  5. #5
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,308
    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


    Here is my lightly tested solution. I just added the if statement that delegates to Object.create. I think this is all we need to do.

    Code:
    Ext.Object.chain = function(object) {
        if (Object.create) {
            return Object.create(object);
        }
        TemplateClass.prototype = object;
        var result = new TemplateClass();
        TemplateClass.prototype = null;
        return result;
    }
    
    // Test
    Ext.Object.chain({key: 'value'});

  6. #6
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,335
    Vote Rating
    129
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    How about?

    Code:
        Ext.Object.chain = Object.create || function (object) {
             TemplateClass.prototype = object;
            var result = new TemplateClass();
            TemplateClass.prototype = null;
            return result;
        }
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

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