Skip to content

Output aggregated allocation call stacks #303

@Lukasa

Description

@Lukasa

package-benchmark makes it very easy to guard against regressions in allocation counts. However, when a regression does occur, it does not offer much in the way of diagnostic tools to work out where the new allocation was added. In principle Instruments or dtrace can be used to determine this, but the output from those tools is tainted somewhat by the package-benchmark harness itself, as those tools don't know what the measurement window was.

A very useful feature would be a flag to record and output aggregated allocation call stacks. If those stacks are also sorted by allocation count (or output in a structured format that is amenable to further automated processing) it will make it a lot easier to quickly compare the allocations from the before/after flow and determine where the new allocations are.

There are some risks here. Care will need to be taken not to heap allocate in the process of walking the call stack, or we'll trigger infinite recursion. We'll also need to consider how much effort we want to put into supporting older Swift releases, or cases where the frame pointer has been omitted. If we choose not to care about the cases where the frame pointer is omitted, walking the stack should be fairly easy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions