diff --git a/src/SamplesApp/Benchmarks.Shared/Benchmarks.Shared.projitems b/src/SamplesApp/Benchmarks.Shared/Benchmarks.Shared.projitems index 2cb6bdcc713e..8cda50bf2988 100644 --- a/src/SamplesApp/Benchmarks.Shared/Benchmarks.Shared.projitems +++ b/src/SamplesApp/Benchmarks.Shared/Benchmarks.Shared.projitems @@ -22,6 +22,7 @@ + diff --git a/src/SamplesApp/Benchmarks.Shared/Suite/Windows_UI_Xaml_Controls/DependencyPropertyBench/SimpleDPBenchmark.cs b/src/SamplesApp/Benchmarks.Shared/Suite/Windows_UI_Xaml_Controls/DependencyPropertyBench/SimpleDPBenchmark.cs new file mode 100644 index 000000000000..a9194689ab04 --- /dev/null +++ b/src/SamplesApp/Benchmarks.Shared/Suite/Windows_UI_Xaml_Controls/DependencyPropertyBench/SimpleDPBenchmark.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; +using BenchmarkDotNet.Attributes; +using Windows.Foundation; +using Windows.UI.Xaml.Controls; + +namespace SamplesApp.Benchmarks.Suite.Windows_UI_Xaml_Controls.GridBench +{ + public class SimpleDPBenchmark + { + private Grid SUT; + + [GlobalSetup] + public void Setup() + { + SUT = new Grid(); + } + + [Benchmark()] + public void DP_Write() + { + for (int i = 0; i < 100; i++) + { + SUT.Width = i; + } + } + + [Benchmark()] + public void DP_Read() + { + for (int i = 0; i < 100; i++) + { + var r = SUT.Width; + } + } + } +}