From 89e23e0df859a29520d60ef65d933913b6c862f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=86=A0=E5=B3=B0?= Date: Sat, 16 Aug 2025 16:53:28 +0800 Subject: [PATCH] =?UTF-8?q?perf=20:=20=E4=BC=98=E5=8C=96=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F=E7=9A=84=E7=B9=81=E5=BF=99?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认情况下不必检测 --- Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs b/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs index 75a22a21..7528a787 100644 --- a/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs +++ b/Assets/YooAsset/Runtime/OperationSystem/OperationSystem.cs @@ -33,6 +33,7 @@ namespace YooAsset { get { + // NOTE : 单次调用开销约1微秒 return _watch.ElapsedMilliseconds - _frameTime >= MaxTimeSlice; } } @@ -82,10 +83,11 @@ namespace YooAsset } // 更新进行中的异步操作 + bool checkBusy = MaxTimeSlice < long.MaxValue; _frameTime = _watch.ElapsedMilliseconds; for (int i = 0; i < _operations.Count; i++) { - if (IsBusy) + if (checkBusy && IsBusy) break; var operation = _operations[i];