2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								title: Untitled
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								date: 2025-08-22 11:20:14
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								excerpt: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								tags: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								rating: ⭐
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								status: inprogress
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								destination: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								share: false
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								obsidianUIMode: source
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								---
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								# 前言
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								录制视频:[[UFSH2025]卡顿大追猎:排查逐帧瓶颈 | Ari Arnbiornsson Epic Games 开发者关系资深工程师(官方字幕)](https://www.bilibili.com/video/BV1k44mzWEvq/?share_source=copy_web& vd_source=fe8142e8e12816535feaeabd6f6cdc8e)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								# Level Streaming Hitches
 
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								## Using Actor for Static Geometry
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								1.  不要在Actor中放入过多StaticMesh。避免使用Actor—+Stat
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								应该使用:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								1.  PLAS,  Level打包Actor功能。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								2.  PCG
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								3.  ISM/HISM
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								4.  Foliage Tool
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								5.  Niagara/Mass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								## 5- .6 针对大世界流式加载有迭代
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								-  Asynchronous component registration
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								-  Asynchronous physics statecreation/destruction
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								-  Unified/shared budget for AsyncLoading and Level Streaming
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								## Fast Stream Plugin
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								巫师四使用了这个插件。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								# Physics Hitches
 
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								## 优化你的物理
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								1.  使用Simple Physics 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								2.  手动关闭Complex Physics
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								3.  使用Use Simple As Complex
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								## 设置碰撞通道
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								1.  关闭不需要的Overlaps,  也就是关闭不需要Actor的Generate Overlap Events。
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								2.  设置Update Overlap Method During Level Streaming => OnlyUpdateMovable,  可以在ini或者PerActor中惊醒设置(  Actor里可以设置为`UseConfigDefault` )。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								ini位于`[/Script/Engine.Actor]` 
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								## 减小物理场景大小
 
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								1.  物理调试工具:  Chaos Visual Debugger
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								2.  使用物理代理
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
									1.  将多个物理物体替换一个简单物理代理。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								3.  使用异步物理
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
									1.  目前只能使用c++实现(  UE5.5实验性/5.7正式)。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
									2.  或者在下一帧执行traces。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
									3.  减少物理场景的大小或者复杂度,  使得traces更快。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
									4.  相关命令行 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
										1.  LevelStreaming.AllowIncrementalPreRegisterComponents = true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
										2.  LevelStreaming.AllowIncrementalPreUnregisterComponents = true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
										3.  p.Chaos.EnableAsyncInitBody = true
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								# Actor Spawning Hitches
 
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								1.  简化Actor
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								2.  限制Per Frame Spawn Num
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								3.  **延迟初始化组件** 
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								4.  构建Actor对象池,  重用Actor。
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								# PSO Compilation Hittches 
 
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								## PSO Precaching & Bundled PSO Cache
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								1.  5.3之后。默认开启Precacheing,   5.6支持在LoadingScreen 中获取编译Shader进度。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								2.  建议:  PSO Prechacing、Bundled PSO Cache 混用
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								使用`-clearPSODriverCache` 命令行来清理PSOCache,  也可以使用[PSOCacheBuster ](https://github.com/Flassari/PSOCacheBuster )插件自动清理PSOCache。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								使用`r.PSOPrecace.Validaion=2` 通过日志来记录Miss情况。
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								# Garbage Collection Hitches
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								1.  减少UObject数量
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
									1.  StaticMeshActor可能成为一个痛点。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
									2.  使用WorldPartition或者关卡流送来加载角色附近的可见区域。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								2.  使用`obj list -countsort` 来查看所有的UObject。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
									1.  一般低于50w,  否者就需要去研究如果减少他们。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								3.  如果短时间需要创建大量UObejct就得考虑使用对象池。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								4.  在LoaddingScreen/黑屏/屏幕冻结 情况下中执行GC操作。
							 
						 
					
						
							
								
									
										
										
										
											2025-09-06 19:50:39 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								# 同步载入卡
 
							 
						 
					
						
							
								
									
										
										
										
											2025-10-27 18:56:25 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								避免使用同步加载逻辑,可以使用下面的插件来检查项目中是否使用:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								https://github.com/Flassari/CommonValidators