Skip to content

Conversation

@huoyaoyuan
Copy link
Member

@huoyaoyuan huoyaoyuan commented Nov 5, 2025

Continuation of #116422. Contains most usages except I/O redirection for new process.
Combined with little refactors for reading file contents.

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 5, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 5, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

#include "jitmetadatalist.h"

fw.Print("\n");
fs << std::endl;
Copy link
Member

@jakobbotsch jakobbotsch Nov 5, 2025

Choose a reason for hiding this comment

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

Suggested change
fs << std::endl;
fs << "\n";

std::endl will flush the output stream. We do not want to do that for every context we are processing.
Can you please validate the performance of these changes when running superpmi with the -details argument, especially on slower storage mediums?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well an error occurs when doing the test with changed executable. I'm going to debug it first.

Data for main with release exe, testing the 72MB mch generated by tests\JIT\superpmi\superpmicollect:
NVMe:925ms HDD:945ms

Copy link
Member Author

Choose a reason for hiding this comment

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

PR using "\n": NVMe:1050ms HDD:1060ms

Seems that flushing won't be a problem, but formatting becomes less efficiency.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removing fstream usage reverts the performance back to 945ms.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jakobbotsch is it acceptable now? Any other concerns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants