Open heckendorfc opened 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 :-)
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.
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?