Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three libs? #8

Closed
WhiteBlackGoose opened this issue Nov 23, 2021 · 1 comment
Closed

Three libs? #8

WhiteBlackGoose opened this issue Nov 23, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@WhiteBlackGoose
Copy link
Owner

WhiteBlackGoose commented Nov 23, 2021

Codegen

That one is just the core. It has the CodegenInfo object, and everything to get it.

var ci =  CodegenInfoResolver.GetCodegen(() => Add(4, 5));
Console.WriteLine(ci);

Codegen.Assertions

That one is a test suite: it has multiple assertions to verify the behaviour of JIT.

AssertCodegen.BranchesLessThan(5, () => Add(3, 5));

Codegen.Benchmarks

This one will build a report based on a codegen.

CodegenBenchmarkRunner.Run<Bench>();

class Bench
{
    [Benchmark]
    [Input(3, 5)]
    public void Add(int a, int b) => a + b;

    [Benchmark]
    [Input(3, 5, 6)]
    public void Add(int a, int b, int c) => a + b + c;
}

Output:

Method Code size Branches Calls Stack allocated memory Backward jumps (loops)
SomeMethod 43 B 3 - - 2
OtherMethod 164 B 7 11 164 B -

(and prints the codegen)

@WhiteBlackGoose WhiteBlackGoose added the enhancement New feature or request label Nov 23, 2021
@WhiteBlackGoose
Copy link
Owner Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant