Profiling Glamorous Toolkit
There are several ways to profile the execution of Glamorous Toolkit code from within the environment itself.
If we face a synchronous computation, we can just use a Message Tally which is a way of profiling by observing the stack at constant intervals. Profiling the synchronous execution of stylers using message tally shows the steps to profile the styling of a method using this approach. In this case, as styling happens in a worker, we first need to isolate the execution to profile it.
But sometimes, we might not want to do that but rather profile multiple workers at the same time. This can be achieved using VirtualMachineAllProcessesSwitchTelemetry
which provides fine grained signals coming from the virtual machine. Profiling the styling of a method using the virtual machine telemetry shows how profiling of the same method can be achieved without extracting the specific computation separately as is the case with the MessageTally.
Profiling user interfaces can be more involved than looking at computation and background workers. We sometimes want to see profiling split by frame and for each frame we might want to see whethere there was a layout computation or repaint. This is achieved through the GtProfiler
. See Profiling the user interface for a method styling