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

Don't create temporaries in real eigfact. #16768

Merged
merged 1 commit into from
Jun 5, 2016
Merged

Don't create temporaries in real eigfact. #16768

merged 1 commit into from
Jun 5, 2016

Conversation

andreasnoack
Copy link
Member

@stevengj The reason for the allocation was much simpler than expected. When creating the eigenvector matrix from the LAPACK output, the columns were fetched Matlab-like and therefore a lot of temporaries were created. By avoiding the temporaries, I get

julia> @time eig(randn(1000,1000));
  2.206440 seconds (115 allocations: 38.461 MB, 0.29% gc time)

As noted in #16751, the many extra allocations have a modest effect on the timings, though. The eigenvalue computation completely dominates.

Fixes #16751

@stevengj
Copy link
Member

stevengj commented Jun 5, 2016

Thanks for looking into this. I figured the O(n^3) LAPACK part would dominate, but it is still nice to see not so many temporaries created. This is also helpful in tracking down allocations in user code, by avoiding a lot of spurious allocations in base.

@ViralBShah
Copy link
Member

This is 5x faster for eig of small matrices. I tested 100x100. Perhaps deserves a mention in NEWS.

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.

4 participants