{
  "format": "perfr.story",
  "version": 1,
  "title": "After: remove the padding copy",
  "summary": "The retained change passes tightly packed pixels directly to Queue::write_texture. Rasterization and ingestion remain the next costs.",
  "capture": "/blog/captures/native-live-after.perfr.stream",
  "transition_ms": 700,
  "steps": [
    {
      "id": "context",
      "kind": "context",
      "title": "The version we kept",
      "body": "The native client receives the same one-million-event-per-second benchmark configuration. This build removes only the padding allocation and copy; the rasterizer and shader are unchanged. This diagnostic run uses CPU affinity 4,6; the earlier profile was unpinned. The article compares separate unprofiled trials.",
      "duration_ms": 6500,
      "view": {
        "t0_frac": 0.45,
        "t1_frac": 0.46,
        "fit": "content",
        "scroll": {
          "kind": "y",
          "y": 0.0
        },
        "expanded": [
          {
            "kind": "process",
            "pid": 799193
          },
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ],
        "collapsed": [
          {
            "kind": "scheduler"
          },
          {
            "kind": "process",
            "pid": 16711681
          },
          {
            "kind": "process",
            "pid": 761372
          },
          {
            "kind": "process",
            "pid": 761415
          }
        ],
        "focused": [
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ]
      },
      "overlays": [
        {
          "kind": "highlight",
          "id": "main",
          "target": {
            "kind": "track",
            "track": {
              "kind": "thread",
              "pid": 799193,
              "tid": 799193
            }
          }
        }
      ]
    },
    {
      "id": "copy",
      "kind": "applied_fix",
      "title": "Upload the pixels already in memory",
      "body": "Queue::write_texture accepts tightly packed rows. The old pack_rgba_aligned helper is removed. The capture now has 1,365 memmove samples out of 10,680 (12.8%), compared with 34.4% in the original profile. A sample share is not an end-to-end speedup.",
      "duration_ms": 7500,
      "view": {
        "t0_frac": 0.45,
        "t1_frac": 0.46,
        "fit": "span",
        "scroll": {
          "kind": "y",
          "y": 0.0
        },
        "expanded": [
          {
            "kind": "process",
            "pid": 799193
          },
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ],
        "collapsed": [
          {
            "kind": "scheduler"
          },
          {
            "kind": "process",
            "pid": 16711681
          },
          {
            "kind": "process",
            "pid": 761372
          },
          {
            "kind": "process",
            "pid": 761415
          }
        ],
        "focused": [
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ]
      },
      "overlays": [
        {
          "kind": "callout",
          "id": "copy-callout",
          "anchor": {
            "time_frac": 0.455,
            "track": {
              "kind": "thread",
              "pid": 799193,
              "tid": 799193
            },
            "y": 0.35
          },
          "text": "The padding pass is gone; the original image is uploaded directly."
        }
      ]
    },
    {
      "id": "raster",
      "kind": "evidence",
      "title": "The placed image still exists",
      "body": "to_rgba8_placed is unchanged and still runs: 1,333 calls, averaging 0.711 ms in this capture. The compact-texture experiment was reverted because it lost to this smaller change in whole-client CPU measurements.",
      "duration_ms": 7500,
      "view": {
        "t0_frac": 0.45,
        "t1_frac": 0.46,
        "fit": "span",
        "scroll": {
          "kind": "y",
          "y": 0.0
        },
        "expanded": [
          {
            "kind": "process",
            "pid": 799193
          },
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ],
        "collapsed": [
          {
            "kind": "scheduler"
          },
          {
            "kind": "process",
            "pid": 16711681
          },
          {
            "kind": "process",
            "pid": 761372
          },
          {
            "kind": "process",
            "pid": 761415
          }
        ],
        "focused": [
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ]
      },
      "overlays": [
        {
          "kind": "highlight",
          "id": "placed-scope",
          "target": {
            "kind": "scope",
            "scope_id": 2097152
          }
        }
      ]
    },
    {
      "id": "remaining",
      "kind": "evidence",
      "title": "Where the next investigation starts",
      "body": "The column rasterizer leads at 24.8% self and 36.8% inclusive. Ingestion is 18.7% inclusive. These are the remaining costs in this capture; improving the upload does not eliminate them.",
      "duration_ms": 7500,
      "view": {
        "t0_frac": 0.45,
        "t1_frac": 0.46,
        "fit": "span",
        "scroll": {
          "kind": "y",
          "y": 0.0
        },
        "expanded": [
          {
            "kind": "process",
            "pid": 799193
          },
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ],
        "collapsed": [
          {
            "kind": "scheduler"
          },
          {
            "kind": "process",
            "pid": 16711681
          },
          {
            "kind": "process",
            "pid": 761372
          },
          {
            "kind": "process",
            "pid": 761415
          }
        ],
        "focused": [
          {
            "kind": "thread",
            "pid": 799193,
            "tid": 799193
          }
        ]
      },
      "overlays": [
        {
          "kind": "highlight",
          "id": "next-main",
          "target": {
            "kind": "track",
            "track": {
              "kind": "thread",
              "pid": 799193,
              "tid": 799193
            }
          }
        }
      ]
    }
  ]
}