Search Feedback

112
votes

Unity3D profiler must profiler multithreaded code as well

Profiling & Optimization

-

-

Since, as developers, we can rely only on the tools Unity provides to debug and profile, it's very important that these tools are actually comprehensive of the basic necessary functions.
Unity profile cannot profile multithreaded functions, making awkward to understand what's wrong some times.
If a multithreaded routine "spikes" the spike is actually shown in the profiler, but the code shown by the profiler is NOT what spikes, but just the code that is running, in that specific moment, on the MainThread, making profiling of multithreaded code, impossible.

Comments (2)

  1. 9f534a9e5ad91593c3a446a8415d3bbc?d=mm

    andywood

    Oct 14, 2016 15:37

    Being able to profile other threads is absolutely fundamental for a development environment that would consider itself professional grade. It wouldn't be quite so crippling if there was at least a free profiler available somewhere that could do this, but I'm not finding anything.

  2. 7cda9714ec9f33b97a795ef10861cb3b?d=mm

    Arkade

    Aug 18, 2016 17:29

    I believe what the original author alludes to is that if the CPU is loaded by other threads such that the Unity threads are deprived of runtime, the Profiler can notice and attribute it incorrectly. (I say 'can' because I'm not sure what would happen if the Profiler was also deprived?)

    However more of the time, the Unity threads are not really deprived. When Unity threads have no problem but our own threaded code isn't performing adequately, there is (AFAIK) no way to profile those threads. This makes Knuth's advice to only optimize once we've profiled, impossible to follow! Working around this requires either use of custom profiling (Stopwatch) or (worse) guessing! Both consume a *lot* of time.

    Please, until the Unity Profiler supports custom threads (which we'd probably be happy to register with an API or something), could you provide any suggestions of other ways we can investigate performance problems in them?

    Many thanks in advance!

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(8665)

2D

(211)

Ads

(34)

AI & Navigation

(53)

Analytics

(85)

Animation

(288)

Asset Store

(202)

Assets

(480)

Audio

(149)

Cloud Build

(92)

Collaborate

(27)

Docs & Tutorials

(185)

Editor

(2005)

Everyplay

(13)

Game Performance Reporting

(10)

General

(786)

Graphics

(729)

GUI

(345)

Input

(140)

Licensing

(72)

Networking

(150)

Physics

(319)

Platforms

(397)

Profiling & Optimization

(66)

Runtime

(149)

Scripting

(973)

Terrain

(148)

WebGL

(128)