10. lit tle impact on the overall execution. T his sampling technique is u
all mainstream profilers, such as JProfiler, Your K it, xprof [10], an
Message Tally, the standard sampling-based profiler in Pharo Sm
tually describes the execution in terms of C P U consumption and i
each method of Mondrian:
54.8% {11501ms} MOCanvas > > drawOn:
54.8% {11501ms} MORoot(MONode) > > displayOn:
30.9% {6485ms} MONode > > displayOn:
| 18.1% {3799ms} MOEdge > > displayOn:
...
| 8.4% {1763ms} MOEdge > > displayOn:
| | 8.0% {1679ms} MOStraightLineShape > > display:on:
| | 2.6% {546ms} FormCanvas > > line:to:width:color:
...
23.4% {4911ms} MOEdge > > displayOn:
...
We can observe that the virtual machine spent about 54% o
the method displayOn: defined in the class MORoot. A root is the
nested node that contains all the nodes of the edges of the visua
general profiling information says that rendering nodes and edge
11. Domain-Specific P rofiling 3
C P U t i me p rofiling
Which is the relationship?
Mondrian [9] is an open and agile visualization engine. Mondrian describes a
visualization using a graph of (possibly nested) nodes and edges. In June 2010
a serious performance issue was raised1 . Tracking down the cause of the poor
performance was not trivial. We first used a standard sample-based profiler.
E xecution sampling approximates the time spent in an application’s methods
by periodically stopping a program and recording the current set of methods
under executions. Such a profiling technique is relatively accurate since it has
lit tle impact on the overall execution. T his sampling technique is used by almost
all mainstream profilers, such as JProfiler, Your K it, xprof [10], and hprof.
Message Tally, the standard sampling-based profiler in Pharo Smalltalk 2 , tex-
tually describes the execution in terms of C P U consumption and invocation for
each method of Mondrian:
54.8% {11501ms} MOCanvas > > drawOn:
54.8% {11501ms} MORoot(MONode) > > displayOn:
30.9% {6485ms} MONode > > displayOn:
?
| 18.1% {3799ms} MOEdge > > displayOn:
...
| 8.4% {1763ms} MOEdge > > displayOn:
| | 8.0% {1679ms} MOStraightLineShape > > display:on:
| | 2.6% {546ms} FormCanvas > > line:to:width:color:
...
23.4% {4911ms} MOEdge > > displayOn:
...
We can observe that the virtual machine spent about 54% of its time in
the method displayOn: defined in the class MORoot. A root is the unique non-
nested node that contains all the nodes of the edges of the visualization. T his
general profiling information says that rendering nodes and edges consumes a
great share of the C P U time, but it does not help in pinpointing which nodes
and edges are responsible for the time spent. Not all graphical elements equally
consume resources.
Traditional execution sampling profilers center their result on the frames of
the execution stack and completely ignore the identity of the ob ject that received
the method call and its arguments. As a consequence, it is hard to track down
which ob jects cause the slowdown. For the example above, the traditional profiler
says that we spent 30.9% in MONode > > displayOn: without saying which nodes
were actually refreshed too often.
C overage
Petit Parser is a parsing framework combining ideas from scannerless parsing,
53. MetaSpy
Domain-
Domain Specific
Profilers
Source Traditional
Code Profilers
Notas do Editor
\n
\n
\n
Code profilers commonly employ execution sampling as the way to obtain dynamic run-time information\n
\n
\n
\n
\n
\n
What is the relationship between this and the domain? picture again\n
\n
PetitParser is a parsing framework combining ideas from scannerless parsing, parser combinators, parsing expression grammars and packrat parsers to model grammars and parsers as objects that can be reconfigured dynamically.\n
Rigorous test suites try to ensure that each part of the grammar is covered by tests and is well-specified according to the respective language standards. Validating that each production of the grammar is covered by the tests is a difficult activity. As mentioned previously, the traditional tools of the host language work at the method and statement level and thus cannot produce meaningful results in the context of PetitParser where the grammar is modeled as a graph of objects.\n
This is a picture of the XML grammar\n
Rigorous test suites try to ensure that each part of the grammar is covered by tests and is well-specified according to the respective language standards. Validating that each production of the grammar is covered by the tests is a difficult activity. As mentioned previously, the traditional tools of the host language work at the method and statement level and thus cannot produce meaningful results in the context of PetitParser where the grammar is modeled as a graph of objects.\n
\n
new dimension of problem-domain\n
new dimension of problem-domain\n
Specify the Domain interests\n Capture the runtime information\n Present the results\n
\n
\n
\n
\n
\n
\n\n
\n\n
\n
\n
\n
\n
\n
Clicking and drag-and-dropping nodes refreshes the visualization, thus increasing the progress bar of the corresponding nodes. This profile helps identifying unnecessary rendering. We identified a situation in which nodes were refreshing without receiving user actions.\n
\n
What does observeParser do?\n
\n
\n
Software instrumentation monitors the run-time behavior of a system to support a particular kind of analysis.\n
\n
\n
\n
We see that there are many different ways of doing reflection, adaptation, instrumentation, many are low level.\nAnd the ones that are highly flexible cannot break free from the limitations of the language.\n
Adaptation semantic abstraction for composing meta-level structure and behavior.\n
\n
\n
\n
\n
\n
\n
We need to reflect on the dynamic representation of a program, that is, the operational execution.\nThis is called Behavioral Reflection pioneered by Smith in the context of Lisp\n
Behavioral reflection provides a way to intercept and change the execution of a program. It is concerned with execution events, i.e., method execution, message sends, or variable assignments. \n
\n
\n
Code profilers commonly employ execution sampling as the way to obtain dynamic run-time information\n
Code profilers commonly employ execution sampling as the way to obtain dynamic run-time information\n
\n
1. identified the need for domain-specific profiling\n2. empirical validation of domain-specific profiling\n3. presented an infrastructure for domain-specific profiling\n