compomics / compomics-utilities

Open source Java library for computational proteomics
http://compomics.github.io/projects/compomics-utilities.html
29 stars 17 forks source link

WaveletTree CPU usage #55

Open heckendorfc opened 2 years ago

heckendorfc commented 2 years ago

WaveletTree.rangeQuery regularly uses excessive CPU time (10+ cores used when calling with -threads 1), I believe due to JVM overhead in handling the recursion. Is it possible to rewrite this iteratively?

mvaudel commented 2 years ago

Hi and thanks for narrowing down the issue this specifically. We are currently refactoring another section of the code and will look into this issue as soon as we get some bandwidth. I will get back to you as soon as I have looked into it. In the meantime, PRs are most welcome :-)

heckendorfc commented 2 years ago

I tried rewriting rangeQueryOneValue as an iterative algorithm as a proof of concept since it was already tail call, but it doesn't seem to make much difference on the CPU usage. Maybe the problem is more involved and we just have to live with it.