Package org.spongepowered.asm.util.perf
Class Profiler
java.lang.Object
org.spongepowered.asm.util.perf.Profiler
Performance profiler for Mixin.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBegin a new profiler section using the specified name and flagsBegin a new profiler section using the specified path and flagsBegin a new profiler section using the specified nameBegin a new profiler section using the specified pathGet the specified profiler sectionGet all recorded profiler sectionsvoidMark a new phase (time slice) for this profiler, all sections record their current times and then reset to zero.printer(boolean includeFine, boolean group)Get the profiler state with all sections in aPrettyPrinter.voidPrint summary of mixin performance to the consolevoidreset()Reset all profiler statevoidsetActive(boolean active)Set the active state of the profiler.
-
Field Details
-
ROOT
public static final int ROOTFlag to indicate a root section. Root sections are always recorded at the root wherever they occur, but may appear under other sections in order to show the time share of the root section relative to the parent.- See Also:
- Constant Field Values
-
FINE
public static final int FINEFlag to indicate a fine section. Fine sections are always recorded, but are only displayed in the printed output if the includeFine flag is set.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Profiler
public Profiler()
-
-
Method Details
-
setActive
public void setActive(boolean active)Set the active state of the profiler. When activating the profiler is always reset.- Parameters:
active- new active state
-
reset
public void reset()Reset all profiler state -
get
Get the specified profiler section- Parameters:
name- section name- Returns:
- profiler section
-
begin
Begin a new profiler section using the specified path- Parameters:
path- path parts- Returns:
- new profiler section
-
begin
Begin a new profiler section using the specified path and flags- Parameters:
flags- section flagspath- path parts- Returns:
- new profiler section
-
begin
Begin a new profiler section using the specified name- Parameters:
name- section name- Returns:
- new profiler section
-
begin
Begin a new profiler section using the specified name and flags- Parameters:
flags- section flagsname- section name- Returns:
- new profiler section
-
mark
Mark a new phase (time slice) for this profiler, all sections record their current times and then reset to zero. If no times have been recorded in the current phase, the phase is discarded.- Parameters:
phase- Name of the phase
-
getSections
Get all recorded profiler sections -
printer
Get the profiler state with all sections in aPrettyPrinter.- Parameters:
includeFine- Include sections marked as FINEgroup- Group delegated sections with their root instead of in the normal alphabetical order- Returns:
- PrettyPrinter with section data
-
printSummary
public void printSummary()Print summary of mixin performance to the console
-