Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Update to not use _mountImage #2

Merged
merged 1 commit into from
Jan 17, 2014

Conversation

sophiebits
Copy link
Member

See facebook/react#852.

Unfortunately I'm not at all set up to run and test this.

@sebmarkbage
Copy link
Contributor

There shouldn't be a need for another lookup map. Those are not free. We should be able to just store a _mountImage on the child like we used to here. E.g. assign it in createChild.

Note that this is expensive paths for ART because move gets called for every child every time, not just for actual moves.

@sophiebits
Copy link
Member Author

Better?

@@ -140,6 +141,7 @@ var ContainerMixin = merge(ReactMultiChild.Mixin, {
*/
removeChild: function(child) {
child._mountImage.eject();
delete child._mountImage;
Copy link
Contributor

Choose a reason for hiding this comment

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

delete tends to trigger a deopt in heuristics that assume that these are used as maps instead of objects. It's better to reset it to null so that it retains it's hidden class shape.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@sebmarkbage
Copy link
Contributor

hm... This fails the unit test. Not really sure how to get this test running in the open-source environment. It can probably be dropped into the react repo. :/

@sophiebits
Copy link
Member Author

I tried doing that and ran into trouble requiring art. I can look more later.

@sophiebits
Copy link
Member Author

Just updated -- I forgot to store _mountImage on initial mount. Now passes the tests (at least with my runner: #5).

sebmarkbage added a commit that referenced this pull request Jan 17, 2014
Update to not use `_mountImage`
@sebmarkbage sebmarkbage merged commit 927a961 into reactjs:master Jan 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants