Unity Mono



How-To's

Back in Rider 2018.3, we added a performance profiler to Rider. As we try to deliver new features as quickly as possible, the integrated profiler had some limitations: it only supported the profiling of .NET Framework and .NET Core applications on Windows. Now, it’s time to fill the gap. Viewnx 2 for mac. In Rider 2019.1, the profiler gets support for Mono and Mono Unity – and not just on Windows but on macOS and Linux as well.

Let’s look at what it can do for you.

Unity Mono Behavior

Quoting the Unity manual on IL2CPP: IL2CPP (Intermediate Language To C) is a Unity-developed scripting backend which you can use as an alternative to Mono when building projects for various platforms. IL2CPP (An ahead-of-time (AOT) compiler) supports debugging of managed code in the same way as the Mono scripting backend. Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.

What is currently supported?

WindowsmacOSLinux
.NET Framework+n/an/a
.NET Core 1.0++
Mono 5.10++++
Mono Unity 2018.3++++

As you can see, the profiler still lacks support for .NET Core on macOS and Linux. Unfortunately, we can’t do everything at once, so this will happen in a future release. Also, as of EAP3, there are no console profiling tools for macOS and Linux. But, unlike the support for .NET Core, the tools will be added in one of the upcoming 2019.1 EAP releases.

How to profile Mono apps?

Absolutely no changes here. The workflow is the same as with regular .NET Framework apps (more details in this post):

  1. Choose a run configuration (what you’re going to profile).
  2. Choose a profiling configuration (how you’re going to profile). Note that there’s a special profiling configuration for Mono apps: Timeline (Mono). Because of limitations in Mono, other profiling modes are not available.
  3. Run profiling and take snapshots.

How to profile unit tests?

Profiling of Mono unit tests is also supported. Simply select a unit test and then run Profile from the context menu.

Mono Developer Unity

How to profile Mono Unity apps?

This one is a little bit more complicated. The workflow is almost the same, but there’s a difference when it comes to running a profiling session:

  1. Choose a run configuration: For a Unity app, it’s always either Attach to Unity Editor or Attach to Unity Editor and Play configs.
  2. Choose a profiling configuration. As well as with Mono apps, there’s a separate profiling configuration: Timeline (Unity).
  3. Run profiling and get snapshots.
    When profiling a Unity application, the profiling target is always the Unity Editor. The problem is that the Editor is probably running simultaneously with Rider, so you cannot start profiling it. Therefore, when trying to run Timeline (Unity), Riders asks you to:
    1. Close the Unity Editor first.
    2. Run the Timeline (Unity) profiling one more time. Rider will take care of the rest: it will run the Unity Editor and start the profiling session.
Unity Mono

Mac os for lamer. Note that instead of restarting Unity Editor, you have an alternative to simply run the compiled game under profiling. In this case, in step 1 you should select the Unity Executable run configuration and specify the path to the game executable.

Another usage of the Unity Executable configuration is to run one more Unity Editor instance with profiling enabled. All you need is to specify the path to the Unity Editor executable instead of the game.

That’s all for now! To try new Rider profiling capabilities, download the latest Rider 2019.1 EAP. Stay tuned!