Skip to content

xoofx/SuperluminalPerf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SuperluminalPerf build NuGet

SuperluminalPerf is a small .NET managed wrapper around the Superluminal PerformanceAPI.

Superluminal is an outstanding profiler that supports .NET (Core, Framework) applications and provides mixed .NET and Native call stacks.

Features

  • One-to-One mapping with the native Superluminal PerformanceAPI (API Version 3.0)
  • Compatible with netstandard2.0+ and net6.0+
  • Provides binaries or source embedding through a single NuGet package

Usage

// Make sure to initialize Superluminal Performance API at the beginning of your app
// By default will try to load the Superluminal dll from Program files default installation path.
SuperluminalPerf.Initialize();
// If Superluminal is not installed in its default path, you'll have to provide an explicit path to the DLL:
// SuperluminalPerf.Initialize($@"E:\Superluminal\Performance\API\dll\{(IntPtr.Size == 8 ? "x64" : "x86")}\PerformanceAPI.dll");

// You can set the thread name
SuperluminalPerf.SetCurrentThreadName("Hello!");

// You can mark code with begin/end markers
SuperluminalPerf.BeginEvent("MyMarker");
Console.WriteLine("Hello World! Wait for 100ms");
Thread.Sleep(100);
SuperluminalPerf.EndEvent();

Running with Superluminal will produce the following markers:

Superluminal Marker Example

Binaries

SuperluminalPerf is available as a NuGet package: NuGet

Source Embedding

SuperluminalPerf NuGet package comes with source included so that you can internalize your usage of SuperluminalPerf into your project. This can be useful in an environment where you can't easily consume NuGet references.

WARNING: Currently, the sources are not set as readonly, so you should not modify sources in that mode as it will modify the sources for other projects using SuperluminalPerf on your machine. Use this feature at your own risks!

In order to activate this feature you need to:

  • Set the property PackageSuperluminalPerfIncludeSource to true in your project:
    <PropertyGroup>
      <PackageSuperluminalPerfIncludeSource>true</PackageSuperluminalPerfIncludeSource>
    </PropertyGroup>
  • Add the IncludeAssets="Build" to the NuGet PackageReference for SuperluminalPerf:
    <ItemGroup>
      <PackageReference Include="SuperluminalPerf" Version="1.0.0" IncludeAssets="Build"/>
    </ItemGroup>

License

This software is released under the BSD-Clause 2 license.

Credits

Adapted logo performance by Sophia Bai from the Noun Project

Author

Alexandre Mutel aka xoofx.

About

SuperluminalPerf is a small .NET managed wrapper around the Superluminal PerformanceAPI.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages