XRef
Documentation menu
xrefcode.com / docs / cli / profile-diff

$ xref profile diff

On this page
  1. Usage
  2. Arguments and options
  3. Examples
  4. Two recordings of the same process
  5. Reading the output
  6. Provenance

Compare two profiles by sample share: which functions got hotter or cooler. Two recordings of the same binary are compared function by function; with --other NEW_BINARY the second profile is of another build, and functions are paired with match (heuristic, and marked as such).

Usage

xref profile diff [OPTIONS] <BEFORE> <AFTER>

Arguments and options

Arguments

<BEFORE>
The earlier .xprof recording.
<AFTER>
The later .xprof recording.

Options

--other <OTHER>
Binary AFTER was recorded from, when it is another build; functions are then paired heuristically.
--top <TOP>
Number of rows to print.
default 30
--json
Print the comparison as JSON.
--by <BY>
What a row aggregates [possible values: function].
default function
--min-delta <MIN_DELTA>
Omit rows whose share changed by fewer percentage points than this.
default 0

Examples

Two recordings of the same process

Two one-second live profile recordings of the same ripgrep process:

Command
$ xref -b rg profile diff rg.xprof rg-2.xprof --top 6
Output
sample-share delta; cross-build pairs are heuristic; shared modules omitted
  +1.12%  0x42f380 -> 0x42f380 [same_image]
  -0.71%  0x4302b0 -> 0x4302b0 [same_image]
  +0.43%  0x430060 -> 0x430060 [same_image]
  -0.13%  0x4752a0 -> 0x4752a0 [same_image]
  -0.11%  0x4307b0 -> 0x4307b0 [same_image]
  -0.09%  0x10b0c0 -> 0x10b0c0 [same_image]
stderr
xref: load 2.4ms, total 31.7ms

Reading the output

Provenance

Recorded with a development build of xref after 0.4.0 on Linux x86-64, on rg = ripgrep 14.1.1 (official stripped release). Output is unchanged except that whitespace at the end of each line and empty lines at the end of the output are removed; long outputs are cut where marked.

Source: docs/cli/profile-diff.md · generated for the site; edit the Markdown, not this page.