8000 add per-phase profiling to scalac by mkeskells · Pull Request #5848 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

add per-phase profiling to scalac #5848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2017
Merged

Conversation

mkeskells
Copy link
Contributor

No description provided.

@@ -338,6 +338,16 @@ trait ScalaSettings extends AbsScalaSettings

def YstatisticsEnabled = Ystatistics.value.nonEmpty

val YprofileEnabled = BooleanSetting("-Yprofile-enabled", "Enable profiling.")
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole pr is super useful. Thank you!

@@ -0,0 +1,17 @@
package scala.tools.nsc.profile;

/**
Copy link
Member

Choose a reason for hiding this comment

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

Can we simplify and make these docs clearer? There are typos, no capital letter and the actual meat of the docs is hidden under unnecessary words 😄.

@rorygraves
Copy link
Contributor

/rebuild

  - Wall Clock Time (ms) - wall clock time
  - Idle Time (ms) - time blocked
  - cpu time (ms) - reported cpu time
  - user time (ms) - reported user time
  - allocated (mb) - bytes allocated during phase
  - retainedHeap (mb) - retained heap after phase (enable GC for more accurate counts)
  - gcTime (ms) - time spent in GC.

Adds four flags:

-Yprofile-enabled
  Add per phase profiling information

-Yprofile-destination:<file>
  Where to write profiling information (defaults to console if not set)

-Yprofile-run-gc
  Run GC between phases to help gemerate more more accurate memory usage in profiling

-Yprofile-external-tool:<phase>
  Enable calling of ExternalToolHook.before/after around the target phase
@rorygraves
Copy link
Contributor

Better description (from updated git commit):

Add support for phase profiling generating inforamtion per phase:
  - Wall Clock Time (ms) - wall clock time
  - Idle Time (ms) - time blocked
  - cpu time (ms) - reported cpu time
  - user time (ms) - reported user time
  - allocated (mb) - bytes allocated during phase
  - retainedHeap (mb) - retained heap after phase (enable GC for more accurate counts)
  - gcTime (ms) - time spent in GC.

Adds four flags:

-Yprofile-enabled
  Add per phase profiling information

-Yprofile-destination:<file>
  Where to write profiling information (defaults to console if not set)

-Yprofile-run-gc
  Run GC between phases to help gemerate more more accurate memory usage in profiling

-Yprofile-external-tool:<phase>
  Enable calling of ExternalToolHook.before/after around the target phase

@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Jun 27, 2017
Copy link
Member
@retronym retronym left a comment

Choose a reason for hiding this comment

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

I have some ideas about ways to extend this, but I think its a great starting point and we can include in 2.12.3.

Future work:

  • Rather than rendering the profile results to the logger after each compiler run, aggregate them over many runs of the compiler and present summary statistics at the end.
  • Try to reuse some of the MXBean based profiler code from JMH rather than DIY (unfortunately this isn't straightforward with the current API of JMH)

@retronym retronym merged commit ae9b465 into scala:2.12.x Jul 3, 2017
@rorygraves
Copy link
Contributor
rorygraves commented Jul 4, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0