Conversation
…trumentation Keep indexed history loading and shared background statistics preparation, invalidate cached results after history changes, and preserve startup when purchase configuration is unavailable. Remove temporary startup markers, render profilers, and measurement counters. Validation: 301 focused tests, typecheck, lint, ARM64 release build, and Pixel 9 Pro smoke checks for startup, History, and all-time Stats passed.
Restore upstream purchase initialization and remove its workaround-specific tests. Keep the performance changes and timing instrumentation cleanup.
|
Thanks for opening a PR! A few things that help this get reviewed:
PRs that clearly don't follow these likely won't get reviewed in a reasonable timeframe. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Large workout histories make startup take longer and longer. When there are 10s of thousands of records to load this can take in excess of 12 seconds on start which makes the user feel like something is wrong. This change loads as little data as possible at startup, queries other data on demand, and prepares all-time statistics in the background while the user navigates elsewhere, without loading all remaining history into the global store. This gives the majority of the improvement so users with small histories will be unlikely to be able to tell. There were a few other unrelated performance improvements but they were small improvements.
Honestly this is pretty invasive and only effects a tiny handful of people (just me?) so might not be worth it for the main repo. We added an indexed table and searchable columns to speed up history and progression queries, while keeping the original JSON payloads. A more complete solution would break more of that JSON data into directly searchable database fields, so we can query exactly what we need without loading and parsing whole workouts. That is a larger database change and would need to handle older backups carefully.
Review notes: the statistics job runs cooperatively on the JavaScript thread; individual model operations or sorts can exceed the slice budget. Review the database migrations and cache invalidation paths closely.