Skip to content

SPMI: fix performance of repRecordCallSite. - #42192

Merged
sandreenko merged 2 commits into
dotnet:masterfrom
sandreenko:spmiLongReplay
Sep 15, 2020
Merged

sandreenko merged 2 commits into
dotnet:masterfrom
sandreenko:spmiLongReplay

Conversation

@sandreenko

Copy link
Copy Markdown
Contributor

After the fix the replay takes around ~100s (before 1000+) on my machine. It could be further improved but I do not think it is a bottle-neck now.

Note that we initialize this data only under DEBUG and only access this data from CallUtils::GetRecordedCallSiteInfo that is currently unused (as all other methods from CallUtils except GetMethodFullName), @BruceForstall do you remember what was the scenario when we were using CallUtils? If we can delete it we can do nothing for repRecordCallSite and save replay time.

Fixes #41635

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 14, 2020
@AndyAyersMS

Copy link
Copy Markdown
Member

What was causing the perf issues... hash collision?

@sandreenko

Copy link
Copy Markdown
Contributor Author

What was causing the perf issues... hash collision?

It is an artificial huge method that records ~10^4 call site with sigInfo and 3 * 10^5 without, so when we were putting them in the same map its size was several Gigabytes and the bottle-neck was reallocating this map. Now, we use less memory for the records without sigInfo so it works faster.

@sandreenko

Copy link
Copy Markdown
Contributor Author

cc @dotnet/jit-contrib

@BruceForstall BruceForstall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to add a comment, probably to repRecordCallSite, explaining why there are two maps for this particular call (namely, performance).

@BruceForstall do you remember what was the scenario when we were using CallUtils?

I don't remember. We often don't use much CompileResult, except for things we use for ASM diffs.

@sandreenko
sandreenko merged commit 53f4fe4 into dotnet:master Sep 15, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
@sandreenko
sandreenko deleted the spmiLongReplay branch May 17, 2021 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

superpmi: replay of a particular test takes a very long time.

3 participants