Big potential speedup for Jacobian_sparse_CSR::FindFlatIndex()
I noticed that Jacobian_sparse_CSR::FindFlatIndex()
uses linear search to determine the desired index. However, since the values in mColIdxs
are sorted, a bisection search will also work and will be much faster, especially for large matrices.
A quick test showed that switching to bisection search reduced the time for Jacobian generation for the r_process
test from about 400 seconds to 40 seconds on my machine.
Would you be interested in a patch?
Comments (5)
-
repo owner -
reporter Great!
I can't open a pull request for SkyNet myself, but you can find the patched repository at https://bitbucket.org/mreineck_/skynet/commits/all
-
repo owner If you go to your forked SkyNet repo, then click on Pull requests, then "create pull request" you should be able to create a pull request from your master branch to my master branch.
-
repo owner Pull request merged. Works beautifully, thanks!
-
repo owner - changed status to resolved
Merged
- Log in to comment
Definitely!
I knew that the Jacobian generation takes a significant amount of runtime, but I never did more fine-grained profiling to figure out exactly which part dominates. Thank you so much for looking into this, this is awesome!