Performance and Experience

Why Optimize Performance

Miniapp performance is closely tied to user experience. During use, users may encounter the following issues:

  • Slow startup: Long wait time after opening the miniapp
  • Page lag: Frame drops when scrolling lists or interacting
  • Response delay: Buttons don't respond promptly
  • Long blank screen: Page content takes too long to appear

These issues seriously affect user willingness to use the miniapp and lead to churn. As features iterate and pages grow, performance problems become more prominent. Developers should invest in performance optimization alongside feature development to ensure a good user experience.

Two Main Themes of Performance Optimization

Miniapp performance optimization primarily covers two directions: startup performance and runtime performance.

Startup Performance

Startup performance focuses on the time from when a user opens the miniapp to when the first screen content is visible. The shorter the startup time, the faster users enter the miniapp and the lower the churn rate.

Startup performance optimization includes:

Runtime Performance

Runtime performance focuses on smoothness during miniapp use. Good runtime performance means smooth scrolling, responsive interactions, and fluid animations.

Runtime performance optimization includes:

User Experience Optimization

Beyond performance, the following also affects overall user experience:

How to Start Optimizing

1. Use Analysis Tools to Locate Issues

Before optimizing, understand the current performance status of your miniapp. Start with Startup Performance Analysis and FPS Performance Analysis to locate bottlenecks in the startup and runtime phases, then use Experience Score for an overall experience check.

2. Optimize by Priority

Recommended optimization priority:

PriorityDirectionReason
HighStartup performanceDirectly affects user willingness to enter the miniapp
HighsetData optimizationThe most common source of performance issues
MediumFirst screen renderAffects how quickly users see content
MediumMemory optimizationPrevents the miniapp from being reclaimed by the system

3. Monitor Continuously

Performance optimization is an ongoing process. After each version iteration, use analysis tools to check performance metrics and ensure new features haven't introduced performance regressions.

Performance Metrics Reference

MetricRecommended ValueDescription
Startup time (first launch)< 3sIncludes package download time
Startup time (subsequent)< 1.5sUsing locally cached package
FMP (First Meaningful Paint)< 2sTime until users can start interacting
FPS (frame rate)>= 30Below 30 causes noticeable lag
setData payload< 100KBData size per single setData call
Package size< 2MBUse subpackages if exceeded
Experience score>= 85Comprehensive performance and experience rating