Skip to content

Persist privacy-safe TableLoad performance history locally #2395

Closed

Description

@devy1540

Problem

TablePro already has TableLoadTracer, which measures the path from a table click through query execution, result application, grid reload, and the main run loop becoming idle.

However, those measurements currently exist only as live debug logs and Instruments signposts. If an intermittent slowdown happens during normal use, the user must reproduce it while running log stream or Instruments. Past usage cannot be analyzed reliably.

This has already made field diagnosis harder:

We need a small, privacy-safe local history that answers:

  • How often was a table load noticeably slow?
  • Was the time spent in the database driver, result conversion, grid rendering, or the main thread?
  • Does the slowdown correlate with wide results, large results, or many open tabs?
  • Did performance change after an app update?

Proposed solution

Persist one compact summary when a TableLoad trace finishes.

A record should contain only performance and coarse environment metadata:

  • Timestamp
  • App version and build
  • macOS version
  • Load origin: sidebar, restore, re-execute, and so on
  • Database type
  • Total duration
  • Preparation/schema duration
  • Driver fetch duration
  • Result application duration
  • Grid reload duration
  • Main-run-loop-idle duration
  • Outcome and anomaly types
  • Bucketed row count
  • Bucketed column count
  • Bucketed result size
  • Bucketed open-tab count
  • Whether SSH was used

Do not store:

  • Query text
  • Query results
  • Database, schema, or table names
  • Hostnames, ports, or usernames
  • Connection names or IDs
  • File paths
  • Raw error messages
  • AI or MCP content

Use bounded local retention:

  • Local storage only
  • Keep at most 7 days
  • Cap the store at 10,000 records or 5 MB
  • Remove the oldest records first
  • Perform persistence away from the main actor
  • A corrupt or partially written history must never prevent app launch

Provide a deterministic, developer-facing JSON export path so the records can be turned into an external report. No in-app dashboard is required.

Suggested buckets

Rows:

  • 0
  • 1–100
  • 101–1,000
  • 1,001–10,000
  • More than 10,000

Columns:

  • 1–20
  • 21–100
  • 101–500
  • More than 500

Result size:

  • Less than 1 MB
  • 1–10 MB
  • 10–100 MB
  • More than 100 MB

Open tabs:

  • 1
  • 2–5
  • 6–10
  • 11–30
  • More than 30

Acceptance criteria

  • A completed, cancelled, failed, or superseded TableLoad produces one summary record.
  • Records survive an app restart.
  • Records older than the retention period or over the size/count limit are removed automatically.
  • Recording performs no synchronous disk I/O on the main actor.
  • Exported JSON contains none of the sensitive fields listed above.
  • Unit tests cover phase-duration calculation, retention, pruning, privacy filtering, and corrupt-store recovery.
  • Existing TableLoadTracer debug logs and Instruments signposts continue to work.
  • No data leaves the Mac.

Out of scope

  • An in-app performance dashboard or Debug menu
  • Remote telemetry or automatic upload
  • MetricKit integration
  • Crash reporting
  • Continuous CPU sampling
  • User-facing alerts or performance scores
  • Automatic issue submission

These can be considered separately after the local history proves useful.

Alternatives considered

Continue using log stream

Useful for an active reproduction, but debug-level phase timings are not reliably available after an intermittent issue has already happened.

Use Instruments only

Provides the best detailed profile, but requires the user or developer to start a recording before reproducing the issue.

Extend the existing analytics heartbeat

The current heartbeat has a narrow, documented privacy contract and contains no performance history. Adding performance data to it would require separate product and privacy decisions. This issue should remain local-only.

Add an in-app Performance Monitor

A dashboard adds product UI and maintenance cost before the usefulness of the underlying measurements has been validated. The initial implementation should collect and export data without adding a new user-facing surface.

Related database type

N/A / General

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions