Transform optimizations in 5.6 beta?

In this video from Unite, Joachim described optimizations to the transform and support for multi-threading. Just wondering if this is in current beta as some of the slides in the video show 5.6 as target.

edit: when I pasted this I tried to include timestamp, but it got scrubbed. To see what I’m talking about, jump to timestamp 8:05.

If not in current beta, is there a timeline for this release? I’m eagerly awaiting this optimization/feature!

Thanks!
ccs

According to this blog-post, the multi-threaded job system is targeted for Unity 2017, which is going to have its first beta release available in April 2017.

Yeah, there’s two separate things involved here:

  • Optimisations to the way we work with Transforms inside the native code part of Unity - I believe these changes are in 5.6 already.
  • The C# multithreaded job system stuff - this is not coming in 5.6.

Are you sure I’m not seeing the kind of boost I would expect in Cube Mark if this was implemented?


Unity 5.5f3 DX12

vs

Unity 5.6b1 DX12

Although a bit of a boost with Instancing Shaders*

*Note: the default instancing shader does not have bump and normal mapping.

Yes.

Cool in the demo they showed fish swimming with and without the feature, is there a setting for it?

No, the transform optimizations are on for everybody.

EDIT: Or did you mean a setting for turning on the fish? We didn’t think building that into Unity would be a good idea, but you could try placing a fishtank in front of your computer screen and Unity should still work just fine.

5 Likes

So… is there any chance all this transform work will fix the random x,y,z coords when creating a new GameObject in the Hierarchy? I doubt that’s high on anyone’s priority list but it’s always struck me as a weird sort of bug that seems like it ought to be a quick fix.

I actually thought that was unity attempting to intelligently create an object in front of the camera, but truth is, it’s quite a rubbish thing that comes off buggy.

1 Like

No need to be facetious.

OK I’ll see if I can throw together a test/benchmark for it just to see how much of a difference it makes, but it appears to have little impact in my simple cube mark benchmark.

I presume it needs instanced shaders for maximum effect?

Quick test:

10k Cubes
5.5.0f3 DX11 Editor
Standard 19 fps 40 batches
Instanced 20 fps 65 batches?

5.6.0f3 DX11 Editor
Standard 21 fps 41 batches
Instanced 24 fps 67 batches

20k Cubes
5.5.0f3 DX11 Editor
Standard 9 fps 40 batches
Instanced 11 fps 65 batches?

5.6.0f3 DX11 Editor
Standard 10 fps 41 batches
Instanced 11 fps 67 batches

Definitely a minor improvement in performance between 5.5 and 5.6 but not the leap that was shown in the fish demo?

My test code (source below) just generates a lot of cubes stores them in a list and moves them twice per update.

Only tested in the editor as wasn’t this how the fish demo was shown all in editor.

How do we get the same FPS boost as seen in the demo?
Could Unity release the demo?
How much of an impact does different hardware have on the Transform optimisations e.g. CPU

Code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TransTest : MonoBehaviour {

    public GameObject prefab;

    public int cubeCount;

    private List<Transform> cubes;

    public float radius;

    public float speedScale = 10f;

    void Start () {

        cubes = new List<Transform>(cubeCount);

        for (int i = 0; i < cubeCount; i++)
        {
            cubes.Add((Instantiate(prefab, Random.insideUnitSphere * radius, Quaternion.identity) as GameObject).transform);
        }
    }
   
   
    void Update () {
        float dt = Time.deltaTime;

        foreach(Transform c in cubes)
        {
            c.Translate(Random.insideUnitSphere * dt * speedScale);
            c.Translate(Random.insideUnitSphere * dt * speedScale);
        }
    }
}

Note used the inbuilt FPS counter as was hoping for more of a boost;

As Superpig already told you, it’s a separate thing. The multi-threaded job system (the C# API fish demo was using) is not coming in 5.6. Transform optimizations are already in.

The transform optimisations should provide a good performance boost on transform operations (graph below)

Will these internal methods get exposed? Or its in those already ^

see at 44:18


Top profiler is 5.6 (B) which you can see in the above profile screenshots is faster with 24ms vs 28ms.

It’s harder to tell in the deep profile as the 5.6 (B) profilers “Self ms” skews the results more than the 5.5 (A) profiler.

Indeed, I think the Unity devs simply can’t grasp the concept of unpredictability = rubbish.

If I’m reading this graph right then any transform heavy (e.g. 10k mesh renderer) games should see an improvement in performance of around 12ms (8ms in 5.6 vs 20 ms in 5.4).

Now is this relevant to the optimisations in 5.6, or only when the multi-threading is applied in 2017.x?

And what impact should we expect from the transform optimisations in 5.6?

Rewatched the video and it sounds like there are 3 separate optimisations:

  • Native Rendering across all threads [x3] (example in talk PS4)
  • Transform Optimisations on get/set pos + bounding volumes [x2](example XBox)
  • Multi-threaded job code [x?](example Fish Boids Demo PC/Mac in Editor)

Op3 is due in 2017.

Op2 is in 5.6?

What about Op1?

1 Like

If I understand it correctly, one of the performance optimizations on the transforms has to do with delaying the push of update down the hierarchy of child transforms when doing transform sets. This is going to mostly help with larger stacks of transforms, like animated models. Single transform objects won’t really benefit from this part. Based on that slider, however, it does appear that simple single-transform objects with no children should also see a boost.

Anyway I’m glad to hear these optimizations are in. I’m going to attempt to do some benchmarking myself. I will post my results.

ccs

1 Like

is the new transform component in unity 5.6 ? I didnt see it in the release notes