Reproducible Approaches to Client Startup Optimization and Agent Evaluation
This article explores reproducible methodologies for optimizing client startup performance and evaluating AI agents. It covers measurement conditions, resource loading, caching strategies, search implementation with SQLite FTS5, cloud gaming adaptation across multiple devices, and the statistical evaluation of Agent benchmark stability using pass^3 metrics and confidence intervals.
1. Define Metrics Before Optimizing
Performance optimization and capability evaluation often stagnate at mere percentages. A number without specified measurement conditions is neither reproducible nor verifiable.
A game platform’s PC client update notes claimed startup speed increased by up to 60%, high-frequency page loading by up to 50%, and popup opening speed improved to 65%. These figures did not disclose the device models, client versions, whether it was a cold or hot start, sample sizes, or statistical methods. Therefore, this article does not adopt these percentages directly but provides methods you can test yourself.
In a large language model grayscale test, the score rose from 48% to 64%, based on a 50-question Agent benchmark. As discussed in Section 4 below, at this question volume, the statistical evidence for this gap is insufficient.
2. Client Startup and Page Loading Optimization
2.1 Measurement Conditions
Every measurement should record the following:
- Device Tiers: Cover at least low, medium, and high configurations. Record CPU model, memory, GPU, and disk type.
- Startup Definitions: Cold start refers to launching the process after clearing the system file cache, with the endpoint being the first interactive frame. Hot start refers to reactivating an application already residing in the background.
- Sample Size: Run each scenario at least 30 times. Report the median and P90, not just the average.
- Version and Environment: Record client version, system patch version, and network status. It is recommended to disconnect the network during testing to eliminate network jitter.
2.2 Resource Loading and Rendering Pipeline
Slow startups usually stem from synchronously reading a large amount of local resources. Specific practices include:
- Split the startup path into “required for the first screen” and “load after the first screen” groups. Keep synchronous loading for first-screen essentials, and switch the rest to lazy loading.
- Inspect initialization tasks during startup. Move tasks unrelated to the first frame (such as telemetry reporting and plugin scanning) to after the first frame, executing them during idle time.
- Use profiling tools to record blocking calls before the first frame. Change only one thing at a time and compare the changes in the median.
Failure Case: A team made all initialization tasks asynchronous, resulting in blank pages before the first frame, making the app feel slower to users. Asynchrony should only be applied to tasks that do not affect the visible content of the first screen.
2.3 Caching Strategy
High-frequency pages can utilize a two-level cache. An in-memory cache stores recently accessed page data, while a local disk cache stores longer-term data. When entering a page, first render a skeleton screen and the cached data, while asynchronously requesting the latest data. Once the results are fetched, update the UI locally.
The risk of this approach is short-term data inconsistency. Each data type should have a maximum staleness time set. Data exceeding this limit should no longer be marked as the latest result.
2.4 Popups and Component Reuse
Slow popup opening is usually caused by rebuilding the DOM and calculating styles every time. You can implement an instance pool for popup components: hide them instead of destroying them upon closing, and record the number of component creations each time it is opened. If the creation count continuously grows with usage, it indicates a memory leak or unreleased event listeners.
2.5 Unified Search
Unified search can be implemented using the local SQLite FTS5 extension, but three points require attention:
First is tokenization. The default unicode61 tokenizer splits by spaces and punctuation, making it nearly ineffective for Chinese. If substring matching is needed, the trigram tokenizer can be used. However, it cannot match keywords shorter than three characters, so short words need separate handling.
Second is indexed fields. Typically, only game names, aliases, plugin names, and account nicknames should be indexed, avoiding indexing large blocks of configuration content. Fewer fields mean a smaller index and faster writes.
Third is the update strategy. Operations like installation, uninstallation, and renaming should trigger incremental updates. Full rebuilds should only be executed during data migrations or when the index is corrupted.
Queries must have a timeout set. If a timeout or index exception occurs, fall back to a standard LIKE query and log the event. When the local data volume is small, a LIKE query is usually sufficient; there is no need to add complexity just to use FTS5.
2.6 Navigation State Machine
When the filtering and classification paths of a game library are deep, a Finite State Machine (FSM) can effectively describe page routing. States include List, Filtering, Detail, and Popup. Events include Enter, Return, and Filter Change. Every illegal transition should be logged, and the user should be routed back to the List page.
If the routing hierarchy is only two or three levels deep, a standard page stack combined with serializable filter parameters is equally sufficient and much easier to debug.
3. Multi-Device Cloud Gaming Adaptation
The core of multi-device adaptation is tiering based on network and decoding capabilities, rather than tuning parameters for each individual device. The table below provides a starting set of parameters that need to be tested and adjusted in the target network environment.
| Tier | Downlink Bandwidth (Reference) | Decoding Capability | Resolution | Bitrate |
|---|---|---|---|---|
| A | Above 30 Mbps and stable | Hardware decoding, supports 4K | 1080p | High |
| B | 15 to 30 Mbps | Hardware decoding, supports 1080p | 720p | Medium |
| C | Below 15 Mbps, or noticeable packet loss | Software decoding or low-end devices | 540p | Low |
Tier switching must incorporate hysteresis to avoid frequent bouncing between adjacent tiers. For example, upgrade to a higher tier only after meeting its conditions for 10 consecutive seconds; downgrade immediately if any metric degrades.
TVs and VR devices differ from PCs in input methods, display latency, and aspect ratios. Therefore, their input latency and first-frame time must be tested separately, and PC parameters cannot be directly applied.
4. Agent Benchmarking and Stability
4.1 Why Looking at Only One Success is Not Enough
Large model outputs are inherently random. Measuring only “at least one success” (pass@1 or pass@k) includes accidental successes, which can mask the gap between old and new versions. A better indicator of stability is running the same task independently three times and only counting it as a pass if all three attempts succeed. This metric is denoted as pass^3, representing the proportion of tasks passed in all trials.
4.2 Is the Difference Reliable?
Using the grayscale test data as an example: out of 50 questions, the old version answered 24 correctly, and the new version answered 32 correctly.
Treating the two groups as independent samples, the proportional difference is 16 percentage points. Calculated using the Wald approximation, the 95% confidence interval for the old version is approximately 34% to 62%, and for the new version approximately 51% to 77%. These two intervals overlap significantly. The z-score for the difference in proportions is approximately 1.6, indicating a two-tailed p-value greater than 0.05, meaning the difference is not statistically significant.
