Threaded View

    You found a bug! We've classified it as EXTJS-7491 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  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 object.hasOwnProperty usage

    object.hasOwnProperty usage


    I think the way the hasOwnProperty method is used in Ext JS is not very efficient.

    See my modification below. The new code avoids long property lookups all the way to Object by caching the hasOwnProperty method in a local variable. This should improve performance.

    Code:
    Ext.define('Ext.util.Observable', {
        ...
        removeManagedListener : function(item, ename, fn, scope) {
            var me = this,
                ...,
                hasOwn = Object.prototype.hasOwnProperty; // <-- added
    
    
            if (typeof ename !== 'string') {
                options = ename;
                for (ename in options) {
                    // if (options.hasOwnProperty(ename)) {
                    if (hasOwn.call(options, ename)) {     
                        config = options[ename];
                        if (!me.eventOptionsRe.test(ename)) {
                            me.removeManagedListener(item, ename, config.fn || config, config.scope || options.scope);
                        }
                    }
                }
            }
            ...
        },
    ***Edit
    Performance improvement is minor, but it still might be worth it because it's a simple change.

    http://jsperf.com/hasownproperty-caching
    Last edited by LesJ; 8 Oct 2012 at 2:33 PM. Reason: Add test link

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