I have a project which targets net35, net40, net45 and netstandard2.0. (https://weblog.west-wind.com/posts/2017/Jun/22/MultiTargeting-and-Porting-a-NET-Library-to-NET-Core-20). I would like to benchmark each version of dotnet I am targeting to ensure the polyfills I have created for missing features in older versions of .Net perform decently in comparison to the dot net feature. For example net35 does not have any of the types in the System.Collections.Concurrent namespace. Is it possible to do this type of benchmarking with BenchmarkDotNet, and if so how?
new CachingActivatorFactory(
#if NET35
new ReaderWriterCache<ConstructorInfo, Func<object[], object>>(),
#else
new ConcurrentCache<ConstructorInfo, Func<object[],object>>(),
#endif
new LambdaExpressionActivatorFactory(
#if NET45 || NETSTANDARD
new IlEmitCompiler()
#else
new SystemExpressionCompiler()
#endif
)
)