- Home /
How do I compare two Profiler captures against each other?
The Profiler introduction says:
Compare profiling results before and after code changes and determine the improvements you measure.
That sounds like great advice, but how do I do this? The profiler only allows you to load one profile .data file at a time and opening multiple Profiler tabs shows the same data in both. How can I compare two captures if I can only look at one at a time?
Answer by roointan · Sep 04, 2019 at 09:44 AM
You can now use profile analyzer
https://blogs.unity3d.com/2019/05/13/introducing-the-profile-analyzer/
Answer by idbrii · May 16, 2018 at 09:39 PM
There are three methods:
Load a blank project in another instance of Unity and load the second capture there.
Load a before capture and then start recording the after capture.
Use AddFramesFromFile to append multiple short captures. See this answer for a code sample.
Use unix
cator Windowstypeto concatenate the capture files.cat a.data b.data > c.data
However, #2, #3, #4 have the limitation that only 300 frames can be displayed at once. So you need to make sure your first capture displays relevant data in its last 150 frames and that the second capture doesn't exceed 150 frames (or you won't see the first one).
You can even use head to shorten a file head --quiet --bytes 350$$anonymous$$ long.data > short.data, but I often see errors when using multiple:
Unable to read 'E:/tmp/long.data'. File contains FrameData of incompatible version (0x01000000). Expected version is 0x20161226
Using AddFramesFromFile seems to work around this error.
Your answer