diff --git a/README.md b/README.md index 6714697d..7389b94a 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ Label 一直是项目优化的最难点,因为它完全不能和其它的渲 - **资源管线(下载与缓存部分)** - **音频系统** +- **XMLHttpRequest** 启用后可以释放其对主线程的占用,减少卡顿现象。 diff --git a/docs/docs/best-practices/performance-guide.md b/docs/docs/best-practices/performance-guide.md index 79c8120e..555213c3 100644 --- a/docs/docs/best-practices/performance-guide.md +++ b/docs/docs/best-practices/performance-guide.md @@ -104,6 +104,7 @@ Spine 组件现在不仅可以参与动态合图,还能与其他渲染组件 - **资源管线(下载与缓存部分)** - **音频系统** +- **XMLHttpRequest** 启用后可以释放其对主线程的占用,减少卡顿现象。 diff --git a/docs/docs/intro.md b/docs/docs/intro.md index a7a678f8..6f97a985 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -100,6 +100,7 @@ Label 一直是项目优化的最难点,因为它完全不能和其它的渲 - **资源管线(下载与缓存部分)** - **音频系统** +- **XMLHttpRequest** 启用后可以释放其对主线程的占用,减少卡顿现象。 diff --git a/docs/docs/user-guide/multithread/assets/th-a.png b/docs/docs/user-guide/multithread/assets/th-a.png new file mode 100644 index 00000000..7575e119 Binary files /dev/null and b/docs/docs/user-guide/multithread/assets/th-a.png differ diff --git a/docs/docs/user-guide/multithread/assets/th-b.png b/docs/docs/user-guide/multithread/assets/th-b.png new file mode 100644 index 00000000..19a7b825 Binary files /dev/null and b/docs/docs/user-guide/multithread/assets/th-b.png differ diff --git a/docs/docs/user-guide/multithread/thread-asset-pipeline.md b/docs/docs/user-guide/multithread/thread-asset-pipeline.md index d374e6d4..d9abe642 100644 --- a/docs/docs/user-guide/multithread/thread-asset-pipeline.md +++ b/docs/docs/user-guide/multithread/thread-asset-pipeline.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 1 description: "在多线程中执行资源管线。" --- diff --git a/docs/docs/user-guide/multithread/thread-custom.md b/docs/docs/user-guide/multithread/thread-custom.md index 9f17426d..201ab539 100644 --- a/docs/docs/user-guide/multithread/thread-custom.md +++ b/docs/docs/user-guide/multithread/thread-custom.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 description: "轻松地将项目逻辑多线程化。" --- diff --git a/docs/docs/user-guide/multithread/thread-http.md b/docs/docs/user-guide/multithread/thread-http.md new file mode 100644 index 00000000..a8cbee96 --- /dev/null +++ b/docs/docs/user-guide/multithread/thread-http.md @@ -0,0 +1,20 @@ +--- +sidebar_position: 3 +description: "在多线程中使用 XMLHttpRequest。" +--- + +# XMLHttpRequest + +依次点击编辑器的菜单项 **项目 - 社区版设置**,然后勾选 **多线程驱动 XMLHttpRequest**,即可启用这一特性。 + +启用后,有关于 XMLHttpRequest 的操作将会在 Worker 线程中执行,完全释放对主线程的占用。 + +下面是在 Android 设备上,在开启前对游戏帧耗时的分析图: + +![alt text](./assets/th-a.png) + +下面是开启多线程支持后: + +![alt text](./assets/th-b.png) + +可以看到每次发起网络请求的耗时从 15.2ms 降低至 0.5ms。