public final class SpecializationStatistics extends Object
entered
to collect
additional statistics about Truffle DSL nodes. In order for the statistics to be useful the nodes
need to be regenerated using the -Atruffle.dsl.GenerateSpecializationStatistics=true
flag or using the SpecializationStatistics.AlwaysEnabled
annotation.
The easiest way to use this utility is to enable the
--engine.SpecializationStatistics
polyglot option. This should print the histogram
when the engine is closed.
See also the usage tutorial on the website.
Modifier and Type | Class and Description |
---|---|
static interface |
SpecializationStatistics.AlwaysEnabled
Used on nodes to always enable specialization statistics.
|
static class |
SpecializationStatistics.NodeStatistics
Class to collect statistics information per node.
|
Modifier and Type | Method and Description |
---|---|
static SpecializationStatistics |
create()
Creates a new specialization statistics instance.
|
SpecializationStatistics |
enter()
Enters this specialization instance object on the current thread.
|
boolean |
hasData()
Returns
true if the statistics did collect any data, else false . |
void |
leave(SpecializationStatistics prev)
Leaves the currently
entered entered statistics. |
void |
printHistogram(PrintStream stream)
Prints the specialization histogram to the provided stream.
|
void |
printHistogram(PrintWriter writer)
Prints the specialization histogram to the provided writer.
|
public boolean hasData()
true
if the statistics did collect any data, else false
.public void printHistogram(PrintWriter writer)
data
was collected.SpecializationStatistics.printHistogram(PrintWriter)
public void printHistogram(PrintStream stream)
data
was collected.SpecializationStatistics.printHistogram(PrintWriter)
public static SpecializationStatistics create()
entered
to collect data on a thread.public SpecializationStatistics enter()
specializations
that were created on this entered thread. Multiple
threads may be entered at the same time. The caller must make sure to
SpecializationStatistics.leave(SpecializationStatistics)
the current statistics after entering in all cases.public void leave(SpecializationStatistics prev)
entered
entered statistics. It is required to leave a
statistics block after it was entered. It is recommended to use a finally block for this
purpose.