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

speed up ambiguous method checking and intersection; helps #21173 #21351

Merged
merged 2 commits into from
Apr 12, 2017

Conversation

JeffBezanson
Copy link
Member

With this, using ApproxFun goes from 17 sec to 10 sec on the system I'm currently using.

There are two tricks. First, I added obviously_disjoint, which catches easy cases of empty type intersection. Second, I made the ambiguity check a bit more efficient by taking advantage of the issubty flag computed by type intersection to skip part of the specificity check.

src/subtype.c Outdated
}
}
else if (!jl_egal(ai, bi)) {
return 1;
Copy link
Member

Choose a reason for hiding this comment

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

what about unions?

Copy link
Member

Choose a reason for hiding this comment

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

oh, I see, you never will recurse into a union?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, so far I just ignore unions here. Turns out to be pretty effective anyway.

@ararslan ararslan added performance Must go faster types and dispatch Types, subtyping and method dispatch labels Apr 11, 2017
@ararslan
Copy link
Member

@nanosoldier runbenchmarks(ALL, vs=":master")

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

add `obviously_disjoint` fast path to type_morespecific

further helps #21173
@JeffBezanson
Copy link
Member Author

I have a further change that gets another factor of ~2 improvement.

@ararslan
Copy link
Member

@nanosoldier runbenchmarks(ALL, vs=":master")

@JeffBezanson
Copy link
Member Author

I don't expect this to affect any benchmarks --- it's basically all load time and a bit of compile time.

@ararslan
Copy link
Member

Ah, okay. Sorry for triggering Nanosoldier then.

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@JeffBezanson JeffBezanson merged commit b91b411 into master Apr 12, 2017
@JeffBezanson JeffBezanson deleted the jb/help21173 branch April 12, 2017 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants