Skip to content

Commit b994ad2

Browse files
authored
Merge pull request #3812 from wiwei/performancedocs
Add a documentation section on performance
2 parents 92228d9 + e19a095 commit b994ad2

File tree

2 files changed

+180
-101
lines changed

2 files changed

+180
-101
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Performance
2+
3+
## Getting Started
4+
5+
If you are new to Unity performance analysis, there are some great resources that Unity provides that
6+
walk you through the general thought process of how to conduct a performance analysis, along with common
7+
pitfalls and recommendations. As other resources will say, there is no magic solution for performance issues
8+
– every situation is unique – and digging into performance issues involves an iterative process where you
9+
typically identify a problematic scenario, measure the problem (using some sort of profiling tool),
10+
dig into the hotspots (using that profiling tool), test out a fix to that hotspot, and then repeat
11+
until performance is within desired bounds.
12+
13+
**[Introduction to Unity performance optimization for beginners](https://www.youtube.com/watch?v=1e5WY2qf600)**
14+
15+
For people completely new to performance optimization, this is a great video to watch.
16+
17+
**[Unity performance optimization tutorials](https://unity3d.com/learn/tutorials/topics/performance-optimization)**
18+
19+
These tutorials introduce the Unity performance diagnostic tools and then share some
20+
common issues and pitfalls that people new to (and experienced with!) Unity can encounter.
21+
22+
**[Unity optimization best practices](https://docs.unity3d.com/2019.1/Documentation/Manual/BestPracticeUnderstandingPerformanceInUnity.html)**
23+
24+
Additional in-depth best practices that can apply to Unity in general.
25+
26+
**[Event Tracing for Windows Unity Guide](https://docs.unity3d.com/uploads/ExpertGuides/Analyzing_your_game_performance_using_Event_Tracing_for_Windows.pdf)**
27+
28+
This guide goes into using a more advanced method for diving into performance issues using [Windows
29+
Performance Analyzer](https://docs.unity3d.com/uploads/ExpertGuides/Analyzing_your_game_performance_using_Event_Tracing_for_Windows.pdf)
30+
tools. Note that the guide doesn’t include how to take traces from a HoloLens device, which can be done by using the
31+
[HoloLens device portal](https://docs.microsoft.com/en-us/windows/mixed-reality/using-the-windows-device-portal).
32+
The rest of the guide, however, is helpful in setting up symbols when diving into the CPU view, along with a concrete set of things
33+
that you can first try as you explore the WPA tools.
34+
35+
### Other Resources
36+
37+
As a platform built on Unity, all the other performance recommendations for building mixed reality experiences are relevant here:
38+
39+
* [Performance recommendations for Unity](https://docs.microsoft.com/en-us/windows/mixed-reality/performance-recommendations-for-unity)
40+
* [Performance recommendations for immersive headset apps](https://docs.microsoft.com/en-us/windows/mixed-reality/performance-recommendations-for-immersive-headset-apps)
41+
* [Performance recommendations for HoloLens apps](https://docs.microsoft.com/en-us/windows/mixed-reality/performance-recommendations-for-hololens-apps)
42+
43+
## Common Considerations
44+
45+
### Use Single Pass Instanced Rendering
46+
47+
This recommendation is called out in
48+
[other](https://docs.microsoft.com/en-us/windows/mixed-reality/performance-recommendations-for-immersive-headset-apps)
49+
resources, but is worth repeating here because enabling this is crucial for performant mixed reality applications.
50+
For more information on what Single Pass Instanced Rendering is, check out the Unity docs on
51+
[Single Pass Stereo rendering](https://docs.unity3d.com/Manual/SinglePassStereoRendering.html)
52+
and [Single Pass instanced rendering](https://docs.unity3d.com/Manual/SinglePassInstancing.html).
53+
54+
This [Unity doc](https://docs.unity3d.com/Manual/SinglePassStereoRenderingHoloLens.html) describes how
55+
to turn on Single Pass Instanced Rendering. To give some context, it’s been observed in some cases that
56+
turning on this option has saved ~5ms per frame (and when there is a budget of 16.6ms per frame in order
57+
to achieve 60 FPS, this is clearly a massive improvement).
58+
59+
Note that in order to enable this rendering option, it's possible that you may need to update your shaders
60+
to support single pass instanced rendering. See the “Adding Single Pass Stereo rendering support to
61+
Shaders” section of this [resource](https://docs.unity3d.com/Manual/SinglePassStereoRendering.html)
62+
for more details. All the built-in MRTK shaders already support single pass instanced rendering.
63+
Other packages may not (for example, Text Mesh Pro shaders).
64+
65+
## Visual Profiler
66+
67+
The MRTK provides a Visual Profiler, which provides information about the current FPS and memory usage.
68+
69+
It is useful as a tool to identify overall areas for further investigation (for example, if you notice that
70+
looking at specific parts of your experience cause memory to spike or FPS to tank, it can be helpful to
71+
identify that overall part of your app to dig further into). However, it is recommended to turn the
72+
profiler off when doing deeper dives in performance (when you already know what areas aren’t performant),
73+
as the profiler itself adds overhead to the scene. Ultimately when your app ships, it won’t have this
74+
profiler turned on.
75+
76+
The recommended path is to have the visual profiler on during general development to get an overall
77+
sense of performance, and then once particular areas of interest have been identified for further
78+
deep dives (using the Unity profiler, for example), the visual profiler should then be turned off
79+
during those deep dives.

Documentation/toc.yml

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
- name: About MRTK
2-
items:
3-
- name: MRTK v2
4-
href: ../MRTK-vNext.md
5-
- name: Mixed Reality Services
6-
href: ../External/Documentation/MixedRealityServices.md
7-
- name: How-tos
8-
href: ../External/HowTo/README.md
9-
items:
10-
- name: Getting Started
11-
href: GettingStartedWithTheMRTK.md
12-
items:
13-
- name: Downloading MRTK
14-
href: DownloadingTheMRTK.md
15-
- name: Core Features
16-
href: TODO.md
17-
items:
18-
- name: Packages
19-
href: TODO.md
20-
- name: Service Provider
21-
href: MixedRealityConfigurationGuide.md
22-
- name: Input
1+
- name: About MRTK
2+
items:
3+
- name: MRTK v2
4+
href: ../MRTK-vNext.md
5+
- name: Mixed Reality Services
6+
href: ../External/Documentation/MixedRealityServices.md
7+
- name: How-tos
8+
href: ../External/HowTo/README.md
9+
items:
10+
- name: Getting Started
11+
href: GettingStartedWithTheMRTK.md
12+
items:
13+
- name: Downloading MRTK
14+
href: DownloadingTheMRTK.md
15+
- name: Core Features
16+
href: TODO.md
17+
items:
18+
- name: Packages
19+
href: TODO.md
20+
- name: Service Provider
21+
href: MixedRealityConfigurationGuide.md
22+
- name: Input
2323
href: Input/Overview.md
2424
items:
2525
- name: Input Providers
@@ -40,82 +40,82 @@
4040
href: Input/Dictation.md
4141
- name: Hands
4242
href: InputSystem/HandTracking.md
43-
- name: Eye
44-
href: TODO.md
45-
- name: Gaze
46-
href: TODO.md
47-
- name: Interactions and UX Building Blocks
48-
href: TODO.md
49-
items:
50-
- name: Interactable
51-
href: README_Interactable.md
52-
- name: Obeject Manipulation
53-
href: README_ManipulationHandler.md
54-
- name: Fintertip Visualization
55-
href: README_FingertipVisualization.md
56-
- name: Hand Interaction Example
57-
href: README_HandInteractionExamples.md
58-
- name: App Bar
59-
href: README_AppBar.md
60-
- name: Bounding Box
61-
href: README_BoundingBox.md
62-
- name: Button
63-
href: README_Button.md
64-
- name: Object Collection
65-
href: README_ObjectCollection.md
66-
- name: Pointers
67-
href: README_Pointers.md
68-
- name: Slate
69-
href: README_Slate.md
70-
- name: System Keyboard
71-
href: README_SystemKeyboard.md
72-
- name: Tooltips
73-
href: README_Tooltip.md
74-
- name: Solvers
75-
href: README_Solver.md
76-
- name: Spatial Awareness
77-
href: SpatialAwareness/SpatialAwarenessGettingStarted.md
78-
items:
79-
- name: Configuring the Spatial Awareness Mesh Observer
80-
- name: In-Editor Input Simulation
81-
href: InputSimulation/InputSimulationService.md
82-
- name: Diagnostics System
83-
href: Diagnostics/DiagnosticsSystemGettingStarted.md
84-
items:
85-
- name: Configuring the Diagnostics System
86-
href: Diagnostics/ConfiguringDiagnostics.md
87-
- name: Using the Visual Profiler
88-
href: TODO.md
89-
- name: Other Features
90-
href: TODO.md
91-
items:
92-
- name: QR Tracking
93-
href: TODO.md
94-
- name: Spatial Audio
95-
href: TODO.md
96-
- name: Advanced topics
97-
href: TODO.md
98-
items:
99-
- name: Performance
100-
href: TODO.md
101-
- name: Shared Experiences
102-
href: TODO.md
103-
- name: Moving your project from HTK to MRTK
104-
href: TODO.md
105-
- name: Contributing
106-
href: ../CONTRIBUTING.md
107-
items:
108-
- name: Feature Contribution Process
109-
href: ../Feature_Contribution_Process.md
110-
- name: Coding Guidelines
111-
href: ../CodingGuidelines.md
112-
- name: Documentation Guide
113-
href: ../DocumentationGuide.md
114-
- name: Developer Docs Generation
115-
href: DevDocGuide.md
116-
- name: Planning
117-
items:
118-
- name: Roadmap
119-
href: ../Roadmap.md
120-
- name: Notice
121-
href: ../NOTICE.md
43+
- name: Eye
44+
href: TODO.md
45+
- name: Gaze
46+
href: TODO.md
47+
- name: Interactions and UX Building Blocks
48+
href: TODO.md
49+
items:
50+
- name: Interactable
51+
href: README_Interactable.md
52+
- name: Obeject Manipulation
53+
href: README_ManipulationHandler.md
54+
- name: Fintertip Visualization
55+
href: README_FingertipVisualization.md
56+
- name: Hand Interaction Example
57+
href: README_HandInteractionExamples.md
58+
- name: App Bar
59+
href: README_AppBar.md
60+
- name: Bounding Box
61+
href: README_BoundingBox.md
62+
- name: Button
63+
href: README_Button.md
64+
- name: Object Collection
65+
href: README_ObjectCollection.md
66+
- name: Pointers
67+
href: README_Pointers.md
68+
- name: Slate
69+
href: README_Slate.md
70+
- name: System Keyboard
71+
href: README_SystemKeyboard.md
72+
- name: Tooltips
73+
href: README_Tooltip.md
74+
- name: Solvers
75+
href: README_Solver.md
76+
- name: Spatial Awareness
77+
href: SpatialAwareness/SpatialAwarenessGettingStarted.md
78+
items:
79+
- name: Configuring the Spatial Awareness Mesh Observer
80+
- name: In-Editor Input Simulation
81+
href: InputSimulation/InputSimulationService.md
82+
- name: Diagnostics System
83+
href: Diagnostics/DiagnosticsSystemGettingStarted.md
84+
items:
85+
- name: Configuring the Diagnostics System
86+
href: Diagnostics/ConfiguringDiagnostics.md
87+
- name: Using the Visual Profiler
88+
href: TODO.md
89+
- name: Other Features
90+
href: TODO.md
91+
items:
92+
- name: QR Tracking
93+
href: TODO.md
94+
- name: Spatial Audio
95+
href: TODO.md
96+
- name: Advanced topics
97+
href: TODO.md
98+
items:
99+
- name: Performance
100+
href: Performance/PerfGettingStarted.md
101+
- name: Shared Experiences
102+
href: TODO.md
103+
- name: Moving your project from HTK to MRTK
104+
href: TODO.md
105+
- name: Contributing
106+
href: ../CONTRIBUTING.md
107+
items:
108+
- name: Feature Contribution Process
109+
href: ../Feature_Contribution_Process.md
110+
- name: Coding Guidelines
111+
href: ../CodingGuidelines.md
112+
- name: Documentation Guide
113+
href: ../DocumentationGuide.md
114+
- name: Developer Docs Generation
115+
href: DevDocGuide.md
116+
- name: Planning
117+
items:
118+
- name: Roadmap
119+
href: ../Roadmap.md
120+
- name: Notice
121+
href: ../NOTICE.md

0 commit comments

Comments
 (0)