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

Stats #14

Open
alex-hedley opened this issue Jun 9, 2023 · 2 comments
Open

Stats #14

alex-hedley opened this issue Jun 9, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@alex-hedley
Copy link
Owner

Stats

Last Run: 10:16:27 am
Compile: 0.156s
Execute: 0.016s
Memory: 0b
CPU: 0.016s
@alex-hedley alex-hedley converted this from a draft issue Jun 9, 2023
@alex-hedley alex-hedley added the enhancement New feature or request label Jun 9, 2023
@alex-hedley
Copy link
Owner Author

Speeding up CSharpCompilation.Emit?
https://stackoverflow.com/questions/62625367/speeding-up-csharpcompilation-emit

private static T Measure<T>(string caption, Func<T> generator)
{
    var now = DateTime.Now;
    var result = generator();
    var end = DateTime.Now - now;
    Debug.WriteLine($"{caption}: {end.TotalMilliseconds} ms");
    return result;
}
var compilation = Measure("Compile", () => CSharpCompilation.Create(
    "Bar.dll",
    new[] {syntaxTree},
    typeRefs.Select(x => MetadataReference.CreateFromFile(x)),
    new CSharpCompilationOptions(
        OutputKind.DynamicallyLinkedLibrary,
        optimizationLevel: OptimizationLevel.Debug
    )
));

Compile: 43,4261 ms

@TheDanielDoyle
Copy link
Collaborator

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
Status: In Progress
Development

No branches or pull requests

3 participants