filprofiler icon indicating copy to clipboard operation
filprofiler copied to clipboard

Replace CallstackInterner and thread-local callstack with something like indextree

Open itamarst opened this issue 5 years ago • 0 comments

You can have a tree of alternating call_id and line number.

start_call()/finish_call()/set_line_number() are traversals of the tree, occasionally inserting new node if necessary. This should be O(siblings), so pretty fast.

The index into the tree is the only thread-local state you need, and can act as callstack ID too, quite possibly.

The theory is that you then have much faster conversion of callstack to callstack ID, since allocations just do a thread local memory lookup of a constant index, and the start_call()/finish_call()/set_line_number() should be cheaper than doing hash lookups each time.

https://saschagrunert.github.io/indextree/doc/indextree/

itamarst avatar Nov 05 '20 13:11 itamarst