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

Avoid type inference problem in chol which caused a 10x slowdown in stockcorr benchmark without breaking anything #8751

Merged
merged 2 commits into from
Oct 21, 2014

Conversation

andreasnoack
Copy link
Member

@JeffBezanson I could solve the problem by calling another constructor. For solve reason Triangular{eltype(C),typeof(C),uplo,false}(C) worked better than Triangular(C,uplo,false) although the latter method is defined by

function Triangular{T}(A::AbstractMatrix{T}, uplo::Symbol, isunit::Bool=false)
    chksquare(A)
    Triangular{T,typeof(A),uplo,isunit}(A)
end

Is there something wrong with the latter definition that breaks type inference?

@tkelman
Copy link
Contributor

tkelman commented Oct 21, 2014

Should there be a test of chol on a non-BlasFloat type?

@andreasnoack
Copy link
Member Author

Actually, there is a test of chol! for BigFloat, but the new chol bypassed chol!. I'm working towards a reorganisation of the linear algebra tests that has the goal of covering 100pct of the methods. To keep track of that, I want to organise the tests according to the name of the file in base.

JeffBezanson added a commit that referenced this pull request Oct 21, 2014
Avoid type inference problem in chol which caused a 10x slowdown in stockcorr benchmark without breaking anything
@JeffBezanson JeffBezanson merged commit fd2c324 into master Oct 21, 2014
@JeffBezanson
Copy link
Member

Ah, the key seems to be manually inlining false into the Triangular{ } type application instead of passing it through a function.

@andreasnoack andreasnoack deleted the anj/chol branch October 23, 2014 15:12
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.

3 participants