Skip to content

Isolate InProcess benchmarks #2417

Open
@timcassell

Description

@timcassell

One major downside of in-process benchmarks is that, if they produce side-effects, they can affect the results of other benchmarks. See #2197

Currently, in-process benchmarks run on their own dedicated thread to get a semblance of isolation, but it doesn't isolate global state.

I think we can obtain full isolation of the benchmarks using AssemblyLoadContext in Core, and AppDomain in Framework. We target netstandard2.0 which only supports AppDomain, but of course it doesn't work in Core. So we'll have to use reflection to use AssemblyLoadContext, but I think it will be worth it. [Edit] Or it looks like we could use System.Runtime.Loader nuget package, or add netcoreapp2.0 target.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions