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

#1911 - Type instability in genmat_fallback #1981

Merged
merged 2 commits into from
Feb 26, 2020
Merged

#1911 - Type instability in genmat_fallback #1981

merged 2 commits into from
Feb 26, 2020

Conversation

schillic
Copy link
Member

Closes #1911.

# master
julia> @btime genmat(rand(Interval))
  423.462 ns (7 allocations: 464 bytes)

julia> @btime genmat(rand(BallInf, dim=100))
  48.197 μs (315 allocations: 98.44 KiB)

# this branch
julia> @btime genmat(rand(Interval))
  175.353 ns (4 allocations: 272 bytes)

julia> @btime genmat(rand(BallInf, dim=100));
  21.260 μs (7 allocations: 80.02 KiB)
julia> @code_warntype genmat(rand(Interval))
Variables
  #self#::Core.Compiler.Const(LazySets.genmat, false)
  H::Interval{Float64,IntervalArithmetic.Interval{Float64}}

Body::Array{Float64,2}
1%1 = LazySets.genmat_fallback(H)::Array{Float64,2}
└──      return %1

Copy link
Member

@mforets mforets left a comment

Choose a reason for hiding this comment

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

Nice!

@schillic schillic changed the title #1911 - Type instability in genmat_fallback WIP #1911 - Type instability in genmat_fallback Feb 18, 2020
@schillic schillic changed the title WIP #1911 - Type instability in genmat_fallback #1911 - Type instability in genmat_fallback Feb 18, 2020
@schillic schillic requested a review from mforets February 18, 2020 21:44
Copy link
Member

@mforets mforets left a comment

Choose a reason for hiding this comment

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

LGTM (again)

@schillic schillic merged commit 7faf8cb into master Feb 26, 2020
@schillic schillic deleted the schillic/1911 branch February 26, 2020 18:43
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.

Type instability in genmat_fallback
2 participants