mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
Performance: Improve Ember.Object.create speed
This commit is contained in:
parent
b194bafcc8
commit
952b1f6d71
2 changed files with 22 additions and 24 deletions
|
@ -3509,15 +3509,6 @@ ChainNodePrototype.didChange = function(suppressEvent) {
|
||||||
if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }
|
if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }
|
||||||
};
|
};
|
||||||
|
|
||||||
Ember.finishChains = function(obj) {
|
|
||||||
var m = metaFor(obj, false), chains = m.chains;
|
|
||||||
if (chains) {
|
|
||||||
if (chains.value() !== obj) {
|
|
||||||
m.chains = chains = chains.copy(obj);
|
|
||||||
}
|
|
||||||
chains.didChange(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
@ -11817,7 +11808,6 @@ var set = Ember.set, get = Ember.get,
|
||||||
generateGuid = Ember.generateGuid,
|
generateGuid = Ember.generateGuid,
|
||||||
meta = Ember.meta,
|
meta = Ember.meta,
|
||||||
rewatch = Ember.rewatch,
|
rewatch = Ember.rewatch,
|
||||||
finishChains = Ember.finishChains,
|
|
||||||
destroy = Ember.destroy,
|
destroy = Ember.destroy,
|
||||||
schedule = Ember.run.schedule,
|
schedule = Ember.run.schedule,
|
||||||
Mixin = Ember.Mixin,
|
Mixin = Ember.Mixin,
|
||||||
|
@ -11917,9 +11907,18 @@ function makeCtor() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finishPartial(this, m);
|
finishPartial(this, m);
|
||||||
|
var hasChains = (typeof m.chains) !== "undefined";
|
||||||
delete m.proto;
|
delete m.proto;
|
||||||
finishChains(this);
|
|
||||||
|
if (hasChains) {
|
||||||
|
if (m.chains.value() !== this) {
|
||||||
|
m.chains = m.chains.copy(this);
|
||||||
|
}
|
||||||
|
m.chains.didChange(true);
|
||||||
|
}
|
||||||
|
|
||||||
this.init.apply(this, arguments);
|
this.init.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17344,7 +17343,7 @@ Ember.View = Ember.CoreView.extend(
|
||||||
*/
|
*/
|
||||||
_elementDidChange: Ember.observer(function() {
|
_elementDidChange: Ember.observer(function() {
|
||||||
this.forEachChildView(function(view) {
|
this.forEachChildView(function(view) {
|
||||||
var meta = Em.meta(view);
|
var meta = Ember.meta(view);
|
||||||
delete meta.cache['element'];
|
delete meta.cache['element'];
|
||||||
});
|
});
|
||||||
}, 'element'),
|
}, 'element'),
|
||||||
|
|
|
@ -3344,15 +3344,6 @@ ChainNodePrototype.didChange = function(suppressEvent) {
|
||||||
if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }
|
if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }
|
||||||
};
|
};
|
||||||
|
|
||||||
Ember.finishChains = function(obj) {
|
|
||||||
var m = metaFor(obj, false), chains = m.chains;
|
|
||||||
if (chains) {
|
|
||||||
if (chains.value() !== obj) {
|
|
||||||
m.chains = chains = chains.copy(obj);
|
|
||||||
}
|
|
||||||
chains.didChange(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
@ -11650,7 +11641,6 @@ var set = Ember.set, get = Ember.get,
|
||||||
generateGuid = Ember.generateGuid,
|
generateGuid = Ember.generateGuid,
|
||||||
meta = Ember.meta,
|
meta = Ember.meta,
|
||||||
rewatch = Ember.rewatch,
|
rewatch = Ember.rewatch,
|
||||||
finishChains = Ember.finishChains,
|
|
||||||
destroy = Ember.destroy,
|
destroy = Ember.destroy,
|
||||||
schedule = Ember.run.schedule,
|
schedule = Ember.run.schedule,
|
||||||
Mixin = Ember.Mixin,
|
Mixin = Ember.Mixin,
|
||||||
|
@ -11748,9 +11738,18 @@ function makeCtor() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finishPartial(this, m);
|
finishPartial(this, m);
|
||||||
|
var hasChains = (typeof m.chains) !== "undefined";
|
||||||
delete m.proto;
|
delete m.proto;
|
||||||
finishChains(this);
|
|
||||||
|
if (hasChains) {
|
||||||
|
if (m.chains.value() !== this) {
|
||||||
|
m.chains = m.chains.copy(this);
|
||||||
|
}
|
||||||
|
m.chains.didChange(true);
|
||||||
|
}
|
||||||
|
|
||||||
this.init.apply(this, arguments);
|
this.init.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17165,7 +17164,7 @@ Ember.View = Ember.CoreView.extend(
|
||||||
*/
|
*/
|
||||||
_elementDidChange: Ember.observer(function() {
|
_elementDidChange: Ember.observer(function() {
|
||||||
this.forEachChildView(function(view) {
|
this.forEachChildView(function(view) {
|
||||||
var meta = Em.meta(view);
|
var meta = Ember.meta(view);
|
||||||
delete meta.cache['element'];
|
delete meta.cache['element'];
|
||||||
});
|
});
|
||||||
}, 'element'),
|
}, 'element'),
|
||||||
|
|
Loading…
Reference in a new issue