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 dispatch on parameterized function types #31089

Merged
merged 1 commit into from
Feb 16, 2019
Merged

Conversation

JeffBezanson
Copy link
Sponsor Member

This should be a safe subset of #21760. Allows splitting on the type of the function for parameterized types. Does not change dispatch on Types (constructors), since it is not strictly better in that case --- many constructors are abstract types that we can't split on. Improving that case will require a more complex change.

Using the benchmark from #21760:
Before:

  0.000000 seconds
  0.015294 seconds
  0.001139 seconds (10.00 k allocations: 156.250 KiB)
  0.068189 seconds (489 allocations: 7.641 KiB)
  0.042070 seconds (383 allocations: 26.453 KiB)
  0.043586 seconds (383 allocations: 26.453 KiB)

After:

  0.000000 seconds
  0.015087 seconds
  0.001219 seconds (10.00 k allocations: 156.250 KiB)
  0.044221 seconds (489 allocations: 7.641 KiB)
  0.000946 seconds (383 allocations: 26.453 KiB)
  0.000969 seconds (383 allocations: 26.453 KiB)

(Note we are now able to optimize out the first benchmark completely.)

@JeffBezanson JeffBezanson added the performance Must go faster label Feb 16, 2019
Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

Nice speed up, and seems delightfully simple as well!

@JeffBezanson JeffBezanson merged commit dfee945 into master Feb 16, 2019
@JeffBezanson JeffBezanson deleted the jb/mtoffset branch February 16, 2019 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants