Gotta go fast
Download
1 / 22

GOTTA GO FAST - PowerPoint PPT Presentation


  • 165 Views
  • Uploaded on

GOTTA GO FAST. Diagnosing Performance Problems in Unity3D Richard Fine @ London Unity User Group August 2013. Why?. Uh. What?. Sufficiently high overall framerate Ideally 60+ FPS on desktop platforms 30+ FPS on console and mobile Smooth framerate

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' GOTTA GO FAST' - metea


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Gotta go fast
GOTTA GO FAST

  • Diagnosing Performance Problems in Unity3D

  • Richard Fine @ London Unity User Group August 2013


Why?

  • Uh...


What?

  • Sufficiently high overall framerate

    • Ideally 60+ FPS on desktop platforms

    • 30+ FPS on console and mobile

  • Smooth framerate

    • Lower, smoother framerate > higher, uneven framerate

  • Responsive, wait-free experience


Sidebar fps
Sidebar: FPS

  • Avoid it - use seconds per frame instead

  • 30FPS -> 25FPS drop vs 60FPS -> 50FPS drop:

    • Real times:

      • 30FPS: 33.3ms 25FPS: 40ms +6.6ms/frame

      • 60FPS: 16.6ms 50FPS: 20ms +3.3ms/frame

    • Actually only half the extra work being done!


When?

  • Integrate it into development

  • Identify frametime targets/budgets

    • Run experiments on the target hardware

  • Impacts development speed


How?

  • Do fewer things

  • Do crappier things

  • Do more than one thing at a time

  • Do things over multiple frames


Where
Where?

  • Need to know where to focus your efforts

  • Efficient use of dev time

  • Bottleneck principle


Tool 1 stats window
Tool #1: Stats Window

  • Available in all versions of Unity

  • Quick overview of (mostly graphics) stats

  • Most important numbers at the top:

  • Main Thread time

  • Render Thread time


Thread times wot

Time

Thread times? Wot?

Physics

Scripts

Culling

Render

Submission

Draw Calls

Actual

Rendering

Main

Thread

Render

Thread

GPU


Physics

Scripts

Time

Culling

Render

Submission

Draw Calls

Actual

Rendering

Physics

Scripts

Culling

Render

Submission

Draw Calls

Actual

Rendering

Physics

Scripts

Culling

Render

Submission

Draw Calls

Actual

Rendering


Physics

Time

Physics

Scripts

Culling

Render

Submission

Draw Calls

ActualRendering

Actual

Rendering


Physics

Time

Physics

Scripts

Culling

Render

Submission

Draw Calls

ActualRendering

Physics

Scripts

Culling

Render

Submission

Draw Calls

ActualRendering


Physics

Time

Physics

Scripts

Culling

Render

Submission

Draw Calls

ActualRendering

Physics

Scripts

Wait...

Culling

Render

Submission

Draw Calls

ActualRendering


Physics

Time

Physics

Scripts

Culling

Render

Submission

Draw Calls

ActualRendering

Physics

Scripts

Wait...

Culling

Render

Submission

Draw Calls

ActualRendering


Pick your battleground
Pick your battleground

Physics

  • If you’re Main Thread bound:

  • ‘Main Thread’ highest in Stats window

  • Focus on Physics or user scripts

  • Having tons of active objects can cause this too

  • Layer-based culling isn’t fast!

Scripts

Culling

Render

Submission

Draw Calls

Actual

Rendering

Main

Thread

Render

Thread

GPU


Pick your battleground1
Pick your battleground

Physics

  • If you’re Render Thread bound:

  • ‘Renderer’ highest in Stats window

  • Too many draw calls and/or complex materials

  • “Classic” Unity optimization advice - atlas materials, batch objects, improve culling, etc

Scripts

Culling

Render

Submission

Draw Calls

Actual

Rendering

Main

Thread

Render

Thread

GPU


Pick your battleground2
Pick your battleground

Physics

  • If you’re GPU bound:

  • Shows as Main Thread time, due to the wait. (Sometimes).

  • Too many vertices, triangles, fragments...

  • See if it goes away when you change GPU workload

  • Classic GPU advice: fewer polys, smaller textures, etc

Scripts

Culling

Render

Submission

Draw Calls

Actual

Rendering

Main

Thread

Render

Thread

GPU


Tool 2 unity profiler
Tool #2: Unity Profiler

  • In-depth breakdown of where time is being spent

  • Shows other resource levels

  • Unity Pro only



Unity profiler notes
Unity Profiler Notes

  • Prefer builds over in-editor profiling for subtle timings

  • Deep Profiling distorts times heavily

  • Look into adding in-build capture + load into Editor


In conclusion
In Conclusion...

  • Understand where the work is being done

  • Learn what ‘normal’ looks like

  • Experiment

  • Check frequently to help isolate when it changed

  • You can go deeper...


Any questions
Any Questions?

Richard Fine 2013

[email protected]

@Superpig


ad