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

Make filtering cheaper - do not create wrapper object when we are not… #13

Merged
merged 3 commits into from
Jul 18, 2016

Conversation

Gricha
Copy link

@Gricha Gricha commented Jul 18, 2016

… going to use given node. Right now we just simply create wrapped object for every possible case, but this tends to be very ineffective when we are for example creating wrapper objects around NSStrings

FBObjectGraphConfiguration *configuration,
NSArray<NSString *> *namePath) {
if (_ShouldBreakGraphEdge(configuration, sourceElement, [namePath objectAtIndex:0], object_getClass(object))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

objectAtIndex: will crash (raise an exception) if the index is out of bounds. firstObject will return nil instead of crashing, so might wanna switch. I haven't backtracked to see where namePath comes from, maybe it's guaranteed to always have non-zero count.

@kastiglione
Copy link
Contributor

Other than the few comments, looks good 👍

@kastiglione
Copy link
Contributor

:shipit:

@Gricha Gricha merged commit e777469 into master Jul 18, 2016
@Gricha Gricha deleted the cheap-filter branch July 18, 2016 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants