Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] only defProp the deprecated container once per prototype #15008

Merged
merged 1 commit into from
Mar 14, 2017

Conversation

stefanpenner
Copy link
Member

@stefanpenner stefanpenner commented Mar 14, 2017

Currently we defProp once pre FactoryManager.prototype.create.

So if you have 3500 models of the same type, we defProp its class's prototype 3500 times instead of once.

Currently we defProp once pre FactoryManager.prototype.create.
@stefanpenner
Copy link
Member Author

Woah, this is pretty hefty:

emberaddons.com

before:

screen shot 2017-03-13 at 9 05 07 pm

After:

screen shot 2017-03-13 at 9 03 00 pm

@stefanpenner
Copy link
Member Author

cc @rwjblue just a note, we gotta make shit this lands in beta.

@stefanpenner stefanpenner merged commit 5a36a7d into master Mar 14, 2017
@stefanpenner stefanpenner deleted the deprecated-container-perf branch March 14, 2017 04:24
@@ -559,6 +559,7 @@ function factoryInjectionsFor(container, fullName) {

// TODO - remove when Ember reaches v3.0.0
function injectDeprecatedContainer(object, container) {
if ('container' in object) { return; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite right, but it may not matter at this point. In the case above (in instantiate) where we are creating an instance on a factory that does not have .extend we have to ensure that the .container property on the instance (which may be the container._fakeContainerToInject is replaced by a getter that issues a deprecation.

Now, considering that this has been deprecated for quite some time (since ember 2.3), it's might be fine to drop support for the deprecation in this odd edge case.

I'll work up a failing test case so you can see what I mean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants