Frontend Development 13 min read

Systematic Performance Optimization of JD Shopping Mini Program for Billion‑User Scale

This article details how JD's massive‑scale shopping mini program achieved a two‑fold performance boost through systematic front‑end optimizations—including code‑package reduction, independent sub‑packages, async loading, pre‑download, selective code injection, first‑screen rendering tricks, and release‑frequency management—providing practical guidance for developers targeting large‑user bases.

JD Tech
JD Tech
JD Tech
Systematic Performance Optimization of JD Shopping Mini Program for Billion‑User Scale

The JD shopping mini program, serving hundreds of millions of users, suffered from slow startup performance, with an 86% launch success rate and significant user loss. To retain users and support growth, the technical team embarked on a systematic performance optimization project.

Performance Metrics and Measurement – The team defined key stages such as loadPackage , First Paint (FP) , First Contentful Paint (FCP) , First Meaningful Paint (FMP) , and Largest Contentful Paint (LCP) . Monitoring fields like _perf_downloadPackage , _perf_evaluateScript , _perf_firstRender , _perf_route , _perf_firstContentfulPaint , _perf_appLaunch , and _perf_largestContentfulPaint were collected via the Zhulong monitoring platform to compute a User Experience Index (UEI).

Optimization Measures

1. Code‑Package Size Reduction – Implemented independent sub‑packages, async sub‑packages, and pre‑download of sub‑packages to shrink the main bundle and reduce download and injection time. For example, the JD Express homepage became an independent sub‑package, cutting its startup time by 420 ms (14.5% reduction).

2. Code Injection Optimization – Enabled lazy loading of required components via configuration:

{
  "lazyCodeLoading": "requiredComponents"
}

Selective injection prevents unused components from loading, and synchronous API calls (e.g., getSystemInfoSync , getStorageSync ) were replaced with asynchronous alternatives.

3. First‑Screen Rendering Optimization – Removed unused custom components, trimmed first‑screen data, deferred off‑screen component loading, and employed data pre‑fetching ( wx.getBackgroundFetchData ) and local caching ( wx.setStorage / wx.getStorage ) to render meaningful content faster.

4. Release Frequency Management – Planned version releases to avoid excessive updates that increase startup latency, and enabled “prefer local version” to let the client use cached code when possible.

Results and Outlook – After applying these strategies, the mini program’s cold‑start time dropped from ~4800 ms to below 2500 ms, and the launch success rate rose above 90%, saving millions of users daily. Future work will continue to refine first‑render performance, explore new rendering engines (e.g., Skyline), and further streamline data payloads.

performanceOptimizationmini-programWeChatcode-splittingJD
JD Tech
Written by

JD Tech

Official JD technology sharing platform. All the cutting‑edge JD tech, innovative insights, and open‑source solutions you’re looking for, all in one place.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.