Profiler

parsley.debug.Profiler
class Profiler

This class is used to store the profile data for a specific group of sub-parsers.

It records the start and end timestamps of the parsers that interact with it. It is possible to use multiple different profilers if you want to establish the cumulative time for a sub-parser instead of the self-time.

This class is mutable, so care must be taken to call reset() between runs, unless you want to accumulate the data.

Attributes

Since

4.4.0

Source
debug.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def reset(): Unit

Clears the data within this profiler.

Clears the data within this profiler.

Attributes

Since

4.4.0

Source
debug.scala
def summary(): Unit

Prints a summary of the data sampled by this profiler.

Prints a summary of the data sampled by this profiler.

After the run(s) of the parser are complete, this method can be used to generate the summary of the sampled data. It will print a table where the total "self-time", number of invocations and average "self-time" are displayed for each profiled sub-parser.

* self-time: this is the amount of time spend in a specific parser, removing the times from within the child parsers.

Attributes

Since

4.4.0

Note

to measure cumulative time of a parser, consider using a separate Profiler object for it instead.

Source
debug.scala