runtime: speed up funcinfo entry lookup#2009
Closed
cpunion wants to merge 20 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2002.
This is a performance follow-up for the compact runtime funcinfo table. It should be reviewed after #2002; this PR is not intended to replace that semantic baseline.
Changes
llgo_funcinfo_entryrecords from function-body.L...anchors so non-LTO and full-LTO builds can materialize funcinfo PCs without per-functiondlsym.symbolID -> funcIndexmap and reuse it for entry/stub-site records, removing the previous O(n*m) stub-site lookup.runtime.FuncForPC(reflect.ValueOf(fn).Pointer()), because backend prologues can place the anchor after the real entry PC..Ltemporary anchors so full-LTO does not retain thousands of local anchor symbols in the final symbol table.Validation
go test ./internal/build ./cl ./ssa -run 'Test(FuncInfo|RuntimeCaller|CallerFrame|DevLTOGlobalDCE)' -count=1go test ./test/go -run 'TestRuntime(LineInfoAndStack|StatementLineInfo|FuncInfoConcurrentFirstUse)$' -count=1 -timeout=40mFuncForPC(function value),Func.FileLine, andruntime.CallerpassedBenchmark Notes
Each executable was run 9 times. Performance cells are
best/trimmed avgafter dropping min and max, withns,us, ormssuffixes. Size values are MiB.mainlacks the new funcinfo support, so theentryandcoldprobes fail withpanic: nil FuncForPC. In thehotprobe,mainFuncForPC/FuncFileLineare nil fast paths and are not functionally comparable.Linux Performance
Linux Size (MiB)
macOS Performance
macOS Size (MiB)