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

reduce time complexity of matrix2graph #107

Merged
merged 1 commit into from
May 12, 2020

Conversation

ghislainb
Copy link
Contributor

This uses an intermediate structure to arrange the indices of the columns of the matrix by rows and avoid the nested for-loops of complexity O(nnz^2).

Benchmark #93 on my local machine, old version :

julia> @time matrix2graph(jacsparsity, false)
447.022331 seconds (1.02 M allocations: 100.974 MiB, 0.01% gc time)

New version :

julia> @time matrix2graph(jacsparsity, false)
  0.158604 seconds (1.18 M allocations: 116.212 MiB, 24.89% gc time)

[my first Julia PR ! 😃 ]

@ChrisRackauckas ChrisRackauckas merged commit 46f7dfb into JuliaDiff:master May 12, 2020
@ChrisRackauckas
Copy link
Member

fantastic!

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.

2 participants