Skip to content

Add a macrobenchmark module and a non-debuggable benchmark build type #112

Open

Description

@lumenpearson

Part of #109.

Nothing in this project measures a frame. There is no benchmark module, no androidx.benchmark, no profileinstaller and no jankstats in the version catalog.

What it buys: FrameTimingMetric reports P50/P90/P99 frame duration and, on API 31+, frameOverrunMs — the number that actually says «this animation drops frames», as opposed to «this animation looks wrong to me».

Three things to get right or it lies:

  • it must not be a debuggable build. A debuggable build is slower by a multiple, and a benchmark run against one measures the debugger;
  • a baseline profile changes the numbers, so either always have one or never, but do not compare a run with to a run without;
  • on an emulator the absolute numbers are meaningless. Run-to-run comparison on one machine is still useful for catching a regression; a claim about a real phone needs a real phone.

The first three things worth pointing it at, each of which this project currently asserts by eye:

  • the day ribbon's three depth levels (Measure what the day ribbon's shader actually costs #111);
  • the jiggle in the tab bar, which is an infinite animation with a per-item period, now shipping to everybody who long-presses a tab;
  • MarqueeText, which runs Int.MAX_VALUE iterations and is the reason half this project's Compose tests hold the clock by hand.

Low priority on purpose: dumpsys gfxinfo and a Perfetto trace answer most questions with no new module at all. Reach for this when a number has to survive a rerun and go into a commit message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Someday

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions