Big potential speedup for Jacobian_sparse_CSR::FindFlatIndex()

Issue #4 resolved
Martin Reinecke created an issue

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)

  1. Jonas Lippuner repo owner

    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!

  2. Jonas Lippuner 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.

  3. Log in to comment