Skip to content

Set time budgets for cold launch, opening a large table and switching tabs #3659

Open

Description

@datlechin

Problem

Three paths decide how fast TablePro feels: cold launch, opening a large table, and switching tabs. Each has been slow before: #519 (opening several tabs and a 500-row table in 0.26), #762 (tab restore over 10 seconds), #2424 (switching between two loaded MongoDB tabs stalled the UI). Each was fixed once, and nothing stops it from coming back.

What exists today:

  • LaunchTracer (apple/TablePro/Core/Diagnostics/LaunchTracer.swift) marks 13 launch stages from process start to the first frame, and prints the table with TABLEPRO_LAUNCH_TRACE=1.
  • TableLoadTracer (apple/TablePro/Core/Diagnostics/TableLoadTracer.swift) traces a table from the sidebar click to the frame presented and keeps a local history (Persist privacy-safe TableLoad performance history locally #2395).
  • A tab switch has no trace at all.
  • The only scripted benchmark is for Data Files (apple/scripts/benchmark-data-files.sh).

No path has a recorded baseline or a time budget, so a slower build ships without anyone noticing.

Proposed solution

  • Trace a tab switch from the key press or click to the first frame of the new tab. Cover a tab whose rows are still loaded and one that re-queries because it fell outside the memory budget (features/tabs.mdx, "Switching tabs").
  • Add a script under apple/scripts/ that runs each path 10 times on a fixed fixture and prints the median and the 95th percentile:
    • Cold launch to first frame, with Reopen Last Session off, and on with 3 connections and 10 tabs.
    • Opening a 1,000,000-row table on local MySQL, PostgreSQL and SQLite, from the click to the first page drawn.
    • Switching among 20 open tabs with Cmd+Shift+] and Ctrl+Tab.
  • Record a baseline for each path on one named Mac, check it in, and set a budget per path from it.
  • Profile the slowest path against its budget and fix what it finds.

Done when the script runs locally in one command, the baselines and budgets are in the repository, and the slowest of the three paths meets its budget.

Alternatives considered

Measure by hand in Instruments: LaunchTracer and TableLoadTracer already emit Points of Interest intervals. That gives one reading at a time, with nothing to compare against.

Platform

macOS

Related database type

N/A / General

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions