Skip to content

gustavopsantos/Cadabra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cadabra

Unity CIL assembly weaving made easy

Benchmark Sample Overview

NOTE: All methods marked with Benchmark will have benchmark code injected.

Before code:

class MyClass
{
    [Benchmark]
    void MyMethod()
    {
        Thread.Sleep(TimeSpan.FromMilliseconds(120));
    }
}

What gets compiled:

class MyClass
{
    [Benchmark]
    void MyMethod()
    {
        Stopwatch stopwatch = Stopwatch.StartNew();
        Thread.Sleep(TimeSpan.FromMilliseconds(120));
        Debug.Log($"MyClass::MyMethod took {stopwatch.ElapsedMilliseconds}ms.");
    }
}

The actual injected class and method names are different

Credits

Releases

No releases published

Packages

No packages published

Languages