This is a dynamic wrapper around the Superluminal Performance API to add instrumentation data while profiling. This wrapper dynamically loads the PerformanceAPI.dll and APIs from it and provides an easy to use API to add instrumentation to your code.
A working installation of Superluminal in a default Program Files forlder.
Following the steps in the Installing from a Git URL you can use the https://github.com/Benedicht/superluminal4u3d.git
URL choosing the Add package from git URL...
menuitem.
Name you threads:
Superluminal.SetCurrentThreadName("My Thread");
Mark your code with Superluminal.BeginEvent()
/EndEvent()
:
Superluminal.BeginEvent("event name", "optional additional data", UnityEngine.Color.red);
try
{
// Add your code here
}
finally
{
Superluminal.EndEvent();
}
Or with a more compact syntax using SuperluminalEvent
:
using (new SuperluminalEvent("event name", "optional additional data", UnityEngine.Color.red))
{
// Add your code here
}
The following code:
public static void OnUpdate()
{
using (new SuperluminalEvent("OnUpdate", UnityEngine.Time.frameCount.ToString("N0"), UnityEngine.Color.green))
{
RequestEventHelper.ProcessQueue();
ConnectionEventHelper.ProcessQueue();
ProtocolEventHelper.ProcessQueue();
PluginEventHelper.ProcessQueue();
BestHTTP.Extensions.Timer.Process();
if (heartbeats != null)
heartbeats.Update();
BufferPool.Maintain();
}
}
Produces the following output in Superluminal:
Superluminal Perf from Alexandre Mutel uses .NET 5 APIs that are not available under Unity3D (like NativeLibrary).