[Feature]: Speed up Trace Statistics view calculation
maxgaponov opened this issue · 2 comments
maxgaponov commented
Requirement
I would like to view Statistics for traces with a big amount of spans.
Problem
Currently Trace Statistics view is calculating very slowly which makes it impossible to use for large traces.
Proposal
No response
Open questions
No response
yurishkuro commented
It's because the code uses linear searches all over the place, so the complexity is at least O(n^2) right now, if not worse. The solution is to build a map spanID->span once and use it in all lookups.
maxgaponov commented
Yes, I figured it out. Wrote a fix and it works much faster now. I will create a PR tomorrow.