adw96 / DivNet

diversity estimation under ecological networks
83 stars 18 forks source link

Speed up 2 #47

Closed mooreryan closed 3 years ago

mooreryan commented 4 years ago

This builds on #45 by adding one more commit. The reason I wanted to separate it out for y'all is that it changes up a lot about how things are stored in memory, both to speed it up a bit more and to get rid of a lot of reduce and apply calls that were causing a lot of memory churn.

mooreryan commented 4 years ago

Here is a profvis run using the original divnet function (i.e., the one from this commit: ad616a02f93800eb1e63e1088fdbc74f01bf78b0)

Screen Shot 2020-01-16 at 22 59 02

And here is the profvis output for the code in this pull request.

Screen Shot 2020-01-16 at 22 57 27

As you can see, much better overall! (Just over 3x faster and about 13x fewer memory allocations)

The data was a subset of 479 taxa from the Lee dataset.

codecov-io commented 4 years ago

Codecov Report

Merging #47 into master will increase coverage by 2.2%. The diff coverage is 83.33%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #47     +/-   ##
========================================
+ Coverage      67%   69.2%   +2.2%     
========================================
  Files          12      11      -1     
  Lines         600     630     +30     
========================================
+ Hits          402     436     +34     
+ Misses        198     194      -4
Impacted Files Coverage Δ
src/mcmh.cpp 100% <100%> (ø)
R/fit_aitchison.R 79.06% <50%> (-13.24%) :arrow_down:
R/utility.R 61.11% <0%> (-5.56%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ad616a0...f39b507. Read the comment docs.

mooreryan commented 4 years ago

Some more updates....I tested compiling DivNet with a couple different compilers, a couple different optimizations, and with and without OpenMp for the Eigen matrix multiplications and it was basically the same runtime regardless.