Repository navigation
pkg/proc: optimize range body lookup cost by trie searching and use moduledata cache to reduce LoadModuleData cost - #4113
Conversation
56bc82d to
872a7cd
Compare
aarzilli
left a comment
There was a problem hiding this comment.
I think this change conflicts with the updated of the derekparker/trie dependency we did today.
| } | ||
|
|
||
| func (bi *BinaryInfo) LookupRangeBodyFunc() *trie.Trie { | ||
| if bi.lookupRangeBodyFunc == nil { |
There was a problem hiding this comment.
Needs to be cleared when we load plugins.
There was a problem hiding this comment.
I think it will be cleared by loadDebugInfoMaps when loading plugins, just like lookupFunc and lookupGenericFunc.
|
Hey @jayantxie thanks for the patch! As @aarzilli mentioned we just updated |
…oduledata cache to reduce LoadModuleData cost Fixes go-delve#4112
872a7cd to
fc3342d
Compare
| if strings.HasPrefix(fn2.Name, fn.Name) && fn2.rangeParentName() == fn.Name { | ||
| fn.extraCache.rangeBodies = append(fn.extraCache.rangeBodies, fn2) | ||
| lookupFunc := bi.LookupRangeBodyFunc() | ||
| for _, key := range lookupFunc.PrefixSearch(fn.Name) { |
There was a problem hiding this comment.
Could probably improve this by introducing a PrefixSearchIter func which returns keys & values (this is more of a note for myself to fix and refactor this in the future).
Fixes #4112