This is a short example on profiling the setup phase of AMG. Here, we use pyinstrument to analyze the construction of a smoothed aggregation solver: