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

Reduced memory requirement for filterPeaks #71

Closed
wants to merge 2 commits into from

Conversation

piplus2
Copy link
Contributor

@piplus2 piplus2 commented Oct 22, 2021

Hi,
I've modified the filterPeaks function to use less memory. The current implementation uses a binary matrix for the peaks occurrence. I've defined a list with row, columns only, which should require less memory, if the occurrence is sparse. I've passed the tests on MacOS.

@piplus2
Copy link
Contributor Author

piplus2 commented Oct 28, 2021

Improved the performances:

using the dataset fiedler2009subset

default:

Unit: milliseconds
                                    expr     min       lq     mean   median       uq      max neval
 filterPeaks(peaks, minFrequency = 0.05) 1.61042 1.631214 1.651639 1.647169 1.661566 1.928226   100

new ver:

Unit: microseconds
                                    expr     min       lq     mean   median      uq      max neval
 filterPeaks(peaks, minFrequency = 0.05) 722.474 728.0705 802.5767 735.6795 816.511 4070.322   100

@codecov
Copy link

codecov bot commented Nov 1, 2021

Codecov Report

Merging #71 (11764c1) into master (b1ca2ff) will decrease coverage by 0.81%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
- Coverage   88.44%   87.63%   -0.82%     
==========================================
  Files          81       81              
  Lines        1411     1439      +28     
==========================================
+ Hits         1248     1261      +13     
- Misses        163      178      +15     
Impacted Files Coverage Δ
R/as.matrix-functions.R 100.00% <100.00%> (ø)
R/filterPeaks-functions.R 79.45% <100.00%> (-20.55%) ⬇️

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 b1ca2ff...11764c1. Read the comment docs.

@sgibb
Copy link
Owner

sgibb commented Nov 1, 2021

That looks really promising! Great enhancement! Unfortunately my time is very limited currently. I will give it a throughout review the next days!

@sgibb
Copy link
Owner

sgibb commented Nov 8, 2021

Closed by #72

sgibb added a commit that referenced this pull request Nov 8, 2021
Reduced memory requirement for filterPeaks; closes #71
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