dotnet/BenchmarkDotNet

Using a benchmark target's return value in a column

Open

#784 建立於 2018年6月7日

在 GitHub 查看
 (22 留言) (29 反應) (0 負責人)C# (11,415 star) (1,054 fork)batch import
help wantedup-for-grabs

描述

I'm writing a deserialization library that is basically taking a file stream and producing a List<T>:

        [Benchmark(Description = "Achievement (WDC1)")]
        public StorageList<WDC1.AchievementEntry> WDC1()
        {
            using (var fs = OpenFile("Achievement.WDC1.db2"))
                return new StorageList<WDC1.AchievementEntry>(fs);
        }

And it goes on for a couple versions.

However, the execution times don't make much sense since they are a measurement of the total amount of entries per file, which changes per version (I have no control over the data). It would make a lot more sense to display the average time needed to load one single element of each version.

I'd love to be able to have an implementation of IColumn that is able to obtain the return value from a benchmark target and work on it.

I have a local project that is basically a dumbed down performance meter but it has its limitations, namely in regards to results output - producing histograms is a chore.

Is there a way to do that, or am I out of luck? By giving the source a quick glance through ILspy, I don't see much.

貢獻者指南

Using a benchmark target's return value in a column · dotnet/BenchmarkDotNet#784 | Good First Issue