├── .gitattributes
├── Xamarin.Forms.Benchmarks
├── AssemblyInfo.cs
├── Utilities
│ ├── INativeViewRenderer.cs
│ ├── DefaultNativeViewRenderer.cs
│ └── BaseBenchmark.cs
├── App.xaml.cs
├── Views
│ ├── BindingLabel.xaml
│ ├── BindingLabel.xaml.cs
│ ├── BindingLabelOneTime.xaml
│ ├── TypedBindingLabel.xaml.cs
│ ├── BindingLabelOneTime.xaml.cs
│ ├── TypedBindingLabelOneTime.xaml.cs
│ ├── TypedBindingLabel.xaml
│ ├── TypedBindingLabelOneTime.xaml
│ ├── MainPage.xaml.cs
│ ├── MainPage.xaml
│ ├── RunnerPage.xaml
│ └── RunnerPage.xaml.cs
├── App.xaml
├── Xamarin.Forms.Benchmarks.csproj
└── Benchmarks
│ ├── Bindings.cs
│ └── Layouts.cs
├── nuget
├── BenchmarkDotNet.0.12.1.1356.nupkg
└── BenchmarkDotNet.Annotations.0.12.1.1356.nupkg
├── Xamarin.Forms.Benchmarks.iOS
├── Resources
│ ├── Default.png
│ ├── Default@2x.png
│ ├── Default-568h@2x.png
│ ├── Default-Portrait.png
│ ├── Default-Portrait@2x.png
│ └── LaunchScreen.storyboard
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Icon1024.png
│ │ ├── Icon120.png
│ │ ├── Icon152.png
│ │ ├── Icon167.png
│ │ ├── Icon180.png
│ │ ├── Icon20.png
│ │ ├── Icon29.png
│ │ ├── Icon40.png
│ │ ├── Icon58.png
│ │ ├── Icon60.png
│ │ ├── Icon76.png
│ │ ├── Icon80.png
│ │ ├── Icon87.png
│ │ └── Contents.json
├── Entitlements.plist
├── Main.cs
├── AppDelegate.cs
├── Info.plist
├── Properties
│ └── AssemblyInfo.cs
└── Xamarin.Forms.Benchmarks.iOS.csproj
├── nuget.config
├── Xamarin.Forms.Benchmarks.Android
├── Resources
│ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ ├── values
│ │ ├── colors.xml
│ │ └── styles.xml
│ └── layout
│ │ ├── Toolbar.xml
│ │ └── Tabbar.xml
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── NativeViewRenderer.cs
├── MainActivity.cs
└── Xamarin.Forms.Benchmarks.Android.csproj
├── Xamarin.Forms.Benchmarks.Console
├── Xamarin.Forms.Benchmarks.Console.csproj
└── Program.cs
├── Directory.Build.targets
├── LICENSE
├── README.md
├── Xamarin.Forms.Benchmarks.sln
├── .gitignore
└── .editorconfig
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms.Xaml;
2 |
3 | [assembly: XamlCompilation (XamlCompilationOptions.Compile)]
--------------------------------------------------------------------------------
/nuget/BenchmarkDotNet.0.12.1.1356.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/nuget/BenchmarkDotNet.0.12.1.1356.nupkg
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/nuget/BenchmarkDotNet.Annotations.0.12.1.1356.nupkg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/nuget/BenchmarkDotNet.Annotations.0.12.1.1356.nupkg
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Utilities/INativeViewRenderer.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Forms.Benchmarks
2 | {
3 | public interface INativeViewRenderer
4 | {
5 | object CreateNativeView (View view);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonathanpeppers/Xamarin.Forms.Benchmarks/HEAD/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Forms.Benchmarks
2 | {
3 | public partial class App : Application
4 | {
5 | public App ()
6 | {
7 | InitializeComponent ();
8 |
9 | MainPage = new NavigationPage (new MainPage ());
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/BindingLabel.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/BindingLabel.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xamarin.Forms;
4 |
5 | namespace Xamarin.Forms.Benchmarks
6 | {
7 | public partial class BindingLabel : Label
8 | {
9 | public BindingLabel ()
10 | {
11 | InitializeComponent ();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/BindingLabelOneTime.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/TypedBindingLabel.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xamarin.Forms;
4 |
5 | namespace Xamarin.Forms.Benchmarks
6 | {
7 | public partial class TypedBindingLabel : Label
8 | {
9 | public TypedBindingLabel ()
10 | {
11 | InitializeComponent ();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/BindingLabelOneTime.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xamarin.Forms;
4 |
5 | namespace Xamarin.Forms.Benchmarks
6 | {
7 | public partial class BindingLabelOneTime : Label
8 | {
9 | public BindingLabelOneTime ()
10 | {
11 | InitializeComponent ();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/TypedBindingLabelOneTime.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xamarin.Forms;
4 |
5 | namespace Xamarin.Forms.Benchmarks
6 | {
7 | public partial class TypedBindingLabelOneTime : Label
8 | {
9 | public TypedBindingLabelOneTime ()
10 | {
11 | InitializeComponent ();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Xamarin.Forms.Benchmarks.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0
4 | true
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Console/Xamarin.Forms.Benchmarks.Console.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net472
4 | Exe
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/TypedBindingLabel.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/layout/Toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/TypedBindingLabelOneTime.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Console/Program.cs:
--------------------------------------------------------------------------------
1 | using BenchmarkDotNet.Configs;
2 | using BenchmarkDotNet.Running;
3 |
4 | namespace Xamarin.Forms.Benchmarks.Console
5 | {
6 | public class Program
7 | {
8 | static void Main(string[] args)
9 | {
10 | var config = default (IConfig);
11 | #if DEBUG
12 | config = new DebugInProcessConfig ();
13 | #endif
14 | BenchmarkSwitcher.FromAssembly (typeof (BaseBenchmark).Assembly).Run (args, config);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/layout/Tabbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace Xamarin.Forms.Benchmarks.iOS {
9 | public class Application {
10 | // This is the main entry point of the application.
11 | static void Main (string [] args)
12 | {
13 | // if you want to use a different Application Delegate class from "AppDelegate"
14 | // you can specify it here.
15 | UIApplication.Main (args, null, "AppDelegate");
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Utilities/DefaultNativeViewRenderer.cs:
--------------------------------------------------------------------------------
1 | namespace Xamarin.Forms.Benchmarks
2 | {
3 | class DefaultNativeViewRenderer : INativeViewRenderer
4 | {
5 | ///
6 | /// We can't create a native view in a Console app. Let's force a layout instead.
7 | ///
8 | public object CreateNativeView (View view)
9 | {
10 | if (view is Layout layout) {
11 | layout.ForceLayout ();
12 | } else {
13 | view.Measure (double.MaxValue, double.MaxValue);
14 | }
15 | return view;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms.Benchmarks.Views;
3 |
4 | namespace Xamarin.Forms.Benchmarks
5 | {
6 | public partial class MainPage : ContentPage
7 | {
8 | public MainPage ()
9 | {
10 | InitializeComponent ();
11 |
12 | BindingContext = new []
13 | {
14 | typeof (Bindings),
15 | typeof (Layouts),
16 | };
17 | }
18 |
19 | void ListView_ItemTapped (object sender, ItemTappedEventArgs e)
20 | {
21 | if (e.Item is Type benchmarkType) {
22 | Navigation.PushAsync (new RunnerPage (benchmarkType));
23 | List.SelectedItem = null;
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/NativeViewRenderer.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 | using Xamarin.Forms;
3 | using AView = Android.Views.View;
4 |
5 | [assembly: Dependency (typeof (Xamarin.Forms.Benchmarks.Droid.NativeViewRenderer))]
6 |
7 | namespace Xamarin.Forms.Benchmarks.Droid
8 | {
9 | class NativeViewRenderer : INativeViewRenderer
10 | {
11 | readonly Context context = global::Android.App.Application.Context;
12 |
13 | public object CreateNativeView (View view)
14 | {
15 | var native = (AView) Platform.Android.Platform.CreateRendererWithContext (view, context);
16 | native.Layout (0, 0, 100, 100);
17 | return native;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Utilities/BaseBenchmark.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | using Xamarin.Forms.Mocks;
3 |
4 | namespace Xamarin.Forms.Benchmarks
5 | {
6 | public class BaseBenchmark
7 | {
8 | ///
9 | /// NOTE: using this over DependencyService, because BDN runs stuff out of proc in a custom way.
10 | ///
11 | public static INativeViewRenderer Renderer = new DefaultNativeViewRenderer ();
12 |
13 | static BaseBenchmark ()
14 | {
15 | // NOTE: This check wouldn't be right for desktop Xamarin.Forms apps.
16 | // This project runs benchmarks in a Console app.
17 | if (RuntimeInformation.IsOSPlatform (OSPlatform.Windows) || RuntimeInformation.IsOSPlatform (OSPlatform.OSX))
18 | MockForms.Init ();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content.PM;
5 | using Android.OS;
6 |
7 | namespace Xamarin.Forms.Benchmarks.Droid
8 | {
9 | [Activity (Label = "Forms Benchmarks", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
10 | public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
11 | {
12 | protected override void OnCreate (Bundle savedInstanceState)
13 | {
14 | TabLayoutResource = Resource.Layout.Tabbar;
15 | ToolbarResource = Resource.Layout.Toolbar;
16 |
17 | base.OnCreate (savedInstanceState);
18 |
19 | BaseBenchmark.Renderer = new NativeViewRenderer ();
20 | global::Xamarin.Forms.Forms.Init (this, savedInstanceState);
21 | LoadApplication (new App ());
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 | using UIKit;
3 |
4 | namespace Xamarin.Forms.Benchmarks.iOS
5 | {
6 | // The UIApplicationDelegate for the application. This class is responsible for launching the
7 | // User Interface of the application, as well as listening (and optionally responding) to
8 | // application events from iOS.
9 | [Register ("AppDelegate")]
10 | public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
11 | {
12 | //
13 | // This method is invoked when the application has loaded and is ready to run. In this
14 | // method you should instantiate the window, load the UI into it and then make the window
15 | // visible.
16 | //
17 | // You have 17 seconds to return from this method, or iOS will terminate your application.
18 | //
19 | public override bool FinishedLaunching (UIApplication app, NSDictionary options)
20 | {
21 | Xamarin.Forms.Forms.Init ();
22 | LoadApplication (new App ());
23 |
24 | return base.FinishedLaunching (app, options);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Jonathan Peppers
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle ("Xamarin.Forms.Benchmarks.Android")]
10 | [assembly: AssemblyDescription ("")]
11 | [assembly: AssemblyConfiguration ("")]
12 | [assembly: AssemblyCompany ("")]
13 | [assembly: AssemblyProduct ("Xamarin.Forms.Benchmarks.Android")]
14 | [assembly: AssemblyCopyright ("Copyright © 2014")]
15 | [assembly: AssemblyTrademark ("")]
16 | [assembly: AssemblyCulture ("")]
17 | [assembly: ComVisible (false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | [assembly: AssemblyVersion ("1.0.0.0")]
26 | [assembly: AssemblyFileVersion ("1.0.0.0")]
27 |
28 | // Add some common permissions, these can be removed if not needed
29 | [assembly: UsesPermission (Android.Manifest.Permission.Internet)]
30 | [assembly: UsesPermission (Android.Manifest.Permission.WriteExternalStorage)]
31 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/RunnerPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
18 |
19 |
32 |
33 |
39 |
40 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 8.0
25 | CFBundleDisplayName
26 | Forms Benchmarks
27 | CFBundleIdentifier
28 | com.jonathanpeppers.forms.benchmarks
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | Forms Benchmarks
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
24 |
27 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle ("Xamarin.Forms.Benchmarks.iOS")]
9 | [assembly: AssemblyDescription ("")]
10 | [assembly: AssemblyConfiguration ("")]
11 | [assembly: AssemblyCompany ("")]
12 | [assembly: AssemblyProduct ("Xamarin.Forms.Benchmarks.iOS")]
13 | [assembly: AssemblyCopyright ("Copyright © 2014")]
14 | [assembly: AssemblyTrademark ("")]
15 | [assembly: AssemblyCulture ("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible (false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid ("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion ("1.0.0.0")]
36 | [assembly: AssemblyFileVersion ("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Benchmarks/Bindings.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 | using BenchmarkDotNet.Attributes;
3 | using BenchmarkDotNet.Order;
4 |
5 | namespace Xamarin.Forms.Benchmarks
6 | {
7 | class BindingData : INotifyPropertyChanged
8 | {
9 | string text;
10 |
11 | public string Text {
12 | get => text;
13 | set {
14 | text = value;
15 | PropertyChanged?.Invoke (this, new PropertyChangedEventArgs (nameof (Text)));
16 | }
17 | }
18 |
19 | public event PropertyChangedEventHandler PropertyChanged;
20 | }
21 |
22 | [MemoryDiagnoser]
23 | [WarmupCount (10), IterationCount (10), InvocationCount (10)] // NOTE: I needed to cap the iterations, as BDN was going on and on
24 | [Orderer (SummaryOrderPolicy.FastestToSlowest)]
25 | public class Bindings : BaseBenchmark
26 | {
27 | BindingData bindingContext = new BindingData {
28 | Text = "Foo"
29 | };
30 |
31 | [Benchmark]
32 | public void ByHand ()
33 | {
34 | var label = new Label ();
35 | var binding = new Binding ("Text");
36 | label.SetBinding (Label.TextProperty, binding);
37 | label.BindingContext = bindingContext;
38 | }
39 |
40 | [Benchmark]
41 | public void ByHandOneTime ()
42 | {
43 | var label = new Label ();
44 | var binding = new Binding ("Text", BindingMode.OneTime);
45 | label.SetBinding (Label.TextProperty, binding);
46 | label.BindingContext = bindingContext;
47 | }
48 |
49 | [Benchmark]
50 | public void Regular ()
51 | {
52 | var label = new BindingLabel {
53 | BindingContext = bindingContext,
54 | };
55 | }
56 |
57 | [Benchmark]
58 | public void RegularOneTime ()
59 | {
60 | var label = new BindingLabelOneTime {
61 | BindingContext = bindingContext,
62 | };
63 | }
64 |
65 | [Benchmark]
66 | public void Typed ()
67 | {
68 | var label = new TypedBindingLabel {
69 | BindingContext = bindingContext,
70 | };
71 | }
72 |
73 | [Benchmark]
74 | public void TypedOneTime ()
75 | {
76 | var label = new TypedBindingLabelOneTime {
77 | BindingContext = bindingContext,
78 | };
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Xamarin.Forms.Benchmarks
2 |
3 | Example of using BenchmarkDotNet to write some benchmarks for Xamarin.Forms concepts.
4 |
5 | ## Results of different bindings
6 |
7 | Running on Windows .NET framework:
8 |
9 | | Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
10 | |--------------- |---------:|----------:|----------:|-------:|-------:|------:|----------:|
11 | | ByHandOneTime | 3.210 us | 0.0836 us | 0.0553 us | 0.5531 | 0.0038 | - | 3.42 KB |
12 | | TypedOneTime | 4.087 us | 0.0560 us | 0.0370 us | 0.8163 | 0.0076 | - | 5.05 KB |
13 | | RegularOneTime | 5.375 us | 0.0117 us | 0.0077 us | 0.9079 | 0.0076 | - | 5.61 KB |
14 | | ByHand | 5.552 us | 0.6508 us | 0.4305 us | 0.5951 | 0.1450 | - | 3.71 KB |
15 | | Typed | 6.992 us | 0.4679 us | 0.3095 us | 0.9155 | 0.3052 | - | 5.67 KB |
16 | | Regular | 7.822 us | 0.3988 us | 0.2638 us | 0.9460 | 0.3128 | - | 5.86 KB |
17 |
18 | ## Using BenchmarkDotnet for Xamarin.Forms in a Console app
19 |
20 | This is likely the simplest option. Setup [BenchmarkDotNet][getting-started] as you would for a normal .NET console app.
21 |
22 | This is what I normally do:
23 |
24 | ```csharp
25 | static void Main(string[] args)
26 | {
27 | var config = default (IConfig);
28 | #if DEBUG
29 | // If you want to debug your benchmarks, you need this
30 | // When taking final measurements, use a Release build.
31 | config = new DebugInProcessConfig ();
32 | #endif
33 | BenchmarkSwitcher.FromAssembly (typeof (Program).Assembly).Run (args, config);
34 | }
35 | ```
36 |
37 | If you want to use Xamarin.Forms on desktop, use my [Xamarin.Forms.Mocks][mocks] mocking library.
38 | This will allow you to benchmark Xamarin.Forms.Core and Xamarin.Forms.Xaml independent of any platform-specific code.
39 |
40 | [getting-started]: https://benchmarkdotnet.org/articles/guides/getting-started.html
41 | [mocks]: https://github.com/jonathanpeppers/Xamarin.Forms.Mocks
42 |
43 | ## Using BenchmarkDotNet in your Xamarin.Android/iOS project
44 |
45 | If trying to get this working in a mobile application project, a couple of notes:
46 |
47 | * Run benchmarks with `Release` builds
48 | * Disable the linker
49 |
50 | Otherwise, the bulk of the work is going to be making a simple UI for choosing benchmarks and running them.
51 |
52 | Check out [BenchmarkDotNet's samples][bdn] for details.
53 |
54 | [bdn]: https://github.com/dotnet/BenchmarkDotNet/tree/master/samples
55 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Benchmarks/Layouts.cs:
--------------------------------------------------------------------------------
1 | using BenchmarkDotNet.Attributes;
2 | using BenchmarkDotNet.Order;
3 |
4 | namespace Xamarin.Forms.Benchmarks
5 | {
6 | [MemoryDiagnoser]
7 | [Orderer (SummaryOrderPolicy.FastestToSlowest)]
8 | public class Layouts : BaseBenchmark
9 | {
10 | const int ViewCount = 100;
11 | const int ViewSize = 10;
12 | static readonly Thickness Empty = new Thickness (0);
13 | static BoxView [] Views;
14 |
15 | [GlobalSetup]
16 | public void GlobalSetup()
17 | {
18 | Views = new BoxView [ViewCount];
19 | for (int i = 0; i < Views.Length; i++) {
20 | Views [i] = new BoxView {
21 | WidthRequest = ViewSize,
22 | HeightRequest = ViewSize,
23 | };
24 | }
25 | }
26 |
27 | [IterationCleanup]
28 | public void Cleanup ()
29 | {
30 | foreach (var view in Views) {
31 | view.Parent = null;
32 | }
33 | }
34 |
35 | [Benchmark]
36 | public void StacksOfStacks ()
37 | {
38 | var verticalStack = new StackLayout {
39 | Padding = Empty,
40 | Spacing = 0,
41 | Orientation = StackOrientation.Vertical,
42 | };
43 | var horizontalStack = default (StackLayout);
44 | for (int i = 0; i < Views.Length; i++) {
45 | if (i % ViewSize == 0) {
46 | verticalStack.Children.Add (horizontalStack = new StackLayout {
47 | Padding = Empty,
48 | Spacing = 0,
49 | Orientation = StackOrientation.Horizontal,
50 | });
51 | }
52 | horizontalStack.Children.Add (Views [i]);
53 | }
54 | Renderer.CreateNativeView (verticalStack);
55 | }
56 |
57 | [Benchmark]
58 | public void GridWithRowsAndColumns ()
59 | {
60 | var grid = new Grid {
61 | Padding = Empty,
62 | ColumnSpacing = 0,
63 | RowSpacing = 0,
64 | };
65 | for (int i = 0; i < ViewSize; i++) {
66 | grid.ColumnDefinitions.Add (new ColumnDefinition { Width = GridLength.Auto });
67 | grid.RowDefinitions.Add (new RowDefinition { Height = GridLength.Auto });
68 | }
69 | for (int i = 0; i < Views.Length; i++) {
70 | var view = Views [i];
71 | Grid.SetColumn (view, i / ViewSize);
72 | Grid.SetRow (view, i % ViewSize);
73 | grid.Children.Add (view);
74 | }
75 | Renderer.CreateNativeView (grid);
76 | }
77 |
78 | [Benchmark]
79 | public void AbsoluteLayoutWithMath ()
80 | {
81 | var layout = new AbsoluteLayout {
82 | Padding = Empty,
83 | WidthRequest = ViewSize * ViewSize,
84 | HeightRequest = ViewSize * ViewSize,
85 | };
86 | var rect = new Rectangle (0, 0, ViewSize, ViewSize);
87 | for (int i = 0; i < Views.Length; i++) {
88 | var view = Views [i];
89 | rect.X = i / ViewSize;
90 | rect.Y = i % ViewSize;
91 | AbsoluteLayout.SetLayoutBounds (view, rect);
92 | layout.Children.Add (view);
93 | }
94 | Renderer.CreateNativeView (layout);
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks/Views/RunnerPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using BenchmarkDotNet.Analysers;
7 | using BenchmarkDotNet.Configs;
8 | using BenchmarkDotNet.Loggers;
9 | using BenchmarkDotNet.Running;
10 | using Xamarin.Forms;
11 | using Xamarin.Forms.Xaml;
12 |
13 | namespace Xamarin.Forms.Benchmarks.Views
14 | {
15 | [XamlCompilation (XamlCompilationOptions.Compile)]
16 | public partial class RunnerPage : ContentPage
17 | {
18 | readonly Type BenchmarkType;
19 |
20 | public RunnerPage (Type benchmarkType)
21 | {
22 | BenchmarkType = benchmarkType;
23 | Title = benchmarkType.Name;
24 | InitializeComponent ();
25 | }
26 |
27 | async void Button_Clicked (object sender, EventArgs e)
28 | {
29 | SetIsRunning (true);
30 | try {
31 | var logger = new ActionLogger (SetSummary);
32 | var summary = await Task.Run (() => BenchmarkRunner.Run (BenchmarkType, DefaultConfig.Instance.AddLogger (logger)));
33 | ConclusionHelper.Print (logger,
34 | summary.BenchmarksCases
35 | .SelectMany (benchmark => benchmark.Config.GetCompositeAnalyser ().Analyse (summary))
36 | .Distinct ()
37 | .ToList ());
38 | } catch (Exception exc) {
39 | SetSummary ("Unhandled exception: " + exc);
40 | } finally {
41 | SetIsRunning (false);
42 | }
43 | }
44 |
45 | void SetIsRunning (bool isRunning)
46 | {
47 | Indicator.IsRunning = isRunning;
48 | Run.IsVisible = !isRunning;
49 | if (isRunning) {
50 | Summary.Text = "";
51 | }
52 | ResizeSummary ();
53 | }
54 |
55 | ///
56 | /// NOTE: called from background thread
57 | ///
58 | void SetSummary (string text)
59 | {
60 | Device.BeginInvokeOnMainThread (() => {
61 | Summary.Text = text;
62 | ResizeSummary ();
63 | });
64 | }
65 |
66 | void ResizeSummary ()
67 | {
68 | Summary.WidthRequest = Summary.HeightRequest = -1;
69 | var size = Summary.Measure (double.MaxValue, double.MaxValue).Request;
70 | Summary.WidthRequest = size.Width;
71 | Summary.HeightRequest = size.Height;
72 | Scroller.ScrollToAsync (0, size.Height, false);
73 | }
74 |
75 | class ActionLogger : ILogger
76 | {
77 | readonly StringBuilder builder = new StringBuilder ();
78 | readonly Action callback;
79 |
80 | public ActionLogger (Action callback)
81 | {
82 | this.callback = callback;
83 | }
84 |
85 | public string Id => nameof (ActionLogger);
86 |
87 | public int Priority => 0;
88 |
89 | public void Flush () => callback (builder.ToString ());
90 |
91 | public void Write (LogKind logKind, string text) => builder.Append (text);
92 |
93 | public void WriteLine ()
94 | {
95 | builder.AppendLine ();
96 | Flush ();
97 | }
98 |
99 | public void WriteLine (LogKind logKind, string text)
100 | {
101 | builder.AppendLine (text);
102 | Flush ();
103 | }
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.Android/Xamarin.Forms.Benchmarks.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {c9e5eea5-ca05-42a1-839b-61506e0a37df}
9 | Library
10 | Xamarin.Forms.Benchmarks.Droid
11 | Xamarin.Forms.Benchmarks.Android
12 | True
13 | True
14 | Resources\Resource.designer.cs
15 | Resource
16 | Properties\AndroidManifest.xml
17 | Resources
18 | Assets
19 | v9.0
20 | true
21 | Xamarin.Android.Net.AndroidClientHandler
22 |
23 |
24 | None
25 |
26 |
27 | true
28 | portable
29 | false
30 | bin\Debug
31 | DEBUG;
32 | prompt
33 | 4
34 |
35 |
36 | true
37 | portable
38 | true
39 | bin\Release
40 | prompt
41 | 4
42 | true
43 | false
44 | armeabi-v7a;x86;x86_64;arm64-v8a
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}
88 | Xamarin.Forms.Benchmarks
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Version 16
3 | VisualStudioVersion = 16.0.30320.27
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Benchmarks.Android", "Xamarin.Forms.Benchmarks.Android\Xamarin.Forms.Benchmarks.Android.csproj", "{8D3AC16F-A23B-490D-9459-BBF13F395B76}"
6 | EndProject
7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Benchmarks.iOS", "Xamarin.Forms.Benchmarks.iOS\Xamarin.Forms.Benchmarks.iOS.csproj", "{5D253A64-6FFB-4231-9857-AF3988B4ECAF}"
8 | EndProject
9 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.Benchmarks", "Xamarin.Forms.Benchmarks\Xamarin.Forms.Benchmarks.csproj", "{FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}"
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Forms.Benchmarks.Console", "Xamarin.Forms.Benchmarks.Console\Xamarin.Forms.Benchmarks.Console.csproj", "{FD663794-AA59-4CBE-A8F5-09A314F97BBB}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Debug|iPhone = Debug|iPhone
17 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
18 | Release|Any CPU = Release|Any CPU
19 | Release|iPhone = Release|iPhone
20 | Release|iPhoneSimulator = Release|iPhoneSimulator
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
26 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|iPhone.ActiveCfg = Debug|Any CPU
27 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|iPhone.Build.0 = Debug|Any CPU
28 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
29 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
30 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|Any CPU.Deploy.0 = Release|Any CPU
33 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|iPhone.ActiveCfg = Release|Any CPU
34 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|iPhone.Build.0 = Release|Any CPU
35 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
36 | {8D3AC16F-A23B-490D-9459-BBF13F395B76}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
37 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
38 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
39 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Debug|iPhone.ActiveCfg = Debug|iPhone
40 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Debug|iPhone.Build.0 = Debug|iPhone
41 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
42 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
43 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
44 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
45 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Release|iPhone.ActiveCfg = Release|iPhone
46 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Release|iPhone.Build.0 = Release|iPhone
47 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
48 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
49 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Debug|Any CPU.Build.0 = Debug|Any CPU
51 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Debug|iPhone.ActiveCfg = Debug|Any CPU
52 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Debug|iPhone.Build.0 = Debug|Any CPU
53 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
54 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
55 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Release|Any CPU.ActiveCfg = Release|Any CPU
56 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Release|Any CPU.Build.0 = Release|Any CPU
57 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Release|iPhone.ActiveCfg = Release|Any CPU
58 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Release|iPhone.Build.0 = Release|Any CPU
59 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
60 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
61 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
62 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
63 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
64 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Debug|iPhone.Build.0 = Debug|Any CPU
65 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
66 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
67 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
68 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Release|Any CPU.Build.0 = Release|Any CPU
69 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Release|iPhone.ActiveCfg = Release|Any CPU
70 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Release|iPhone.Build.0 = Release|Any CPU
71 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
72 | {FD663794-AA59-4CBE-A8F5-09A314F97BBB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
73 | EndGlobalSection
74 | GlobalSection(SolutionProperties) = preSolution
75 | HideSolutionNode = FALSE
76 | EndGlobalSection
77 | GlobalSection(ExtensibilityGlobals) = postSolution
78 | SolutionGuid = {9091143D-E4F1-4C73-AAE9-0FBEF9AF502B}
79 | EndGlobalSection
80 | EndGlobal
81 |
--------------------------------------------------------------------------------
/Xamarin.Forms.Benchmarks.iOS/Xamarin.Forms.Benchmarks.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {5D253A64-6FFB-4231-9857-AF3988B4ECAF}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | {6143fdea-f3c2-4a09-aafa-6e230626515e}
11 | Exe
12 | Xamarin.Forms.Benchmarks.iOS
13 | Resources
14 | Xamarin.Forms.Benchmarks.iOS
15 | true
16 | NSUrlSessionHandler
17 | automatic
18 |
19 |
20 | true
21 | full
22 | false
23 | bin\iPhoneSimulator\Debug
24 | DEBUG
25 | prompt
26 | 4
27 | x86_64
28 | None
29 | true
30 |
31 |
32 | none
33 | true
34 | bin\iPhoneSimulator\Release
35 | prompt
36 | 4
37 | None
38 | x86_64
39 |
40 |
41 | true
42 | full
43 | false
44 | bin\iPhone\Debug
45 | DEBUG
46 | prompt
47 | 4
48 | ARM64
49 | iPhone Developer
50 | true
51 | Entitlements.plist
52 | None
53 | -all
54 |
55 |
56 | none
57 | true
58 | bin\iPhone\Release
59 | prompt
60 | 4
61 | ARM64
62 | iPhone Developer
63 | Entitlements.plist
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | false
76 |
77 |
78 | false
79 |
80 |
81 | false
82 |
83 |
84 | false
85 |
86 |
87 | false
88 |
89 |
90 | false
91 |
92 |
93 | false
94 |
95 |
96 | false
97 |
98 |
99 | false
100 |
101 |
102 | false
103 |
104 |
105 | false
106 |
107 |
108 | false
109 |
110 |
111 | false
112 |
113 |
114 | false
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 | {FFE92FD2-FD88-4EAB-8E0B-2D046E33F00C}
129 | Xamarin.Forms.Benchmarks
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # JustCode is a .NET coding add-in
131 | .JustCode
132 |
133 | # TeamCity is a build add-in
134 | _TeamCity*
135 |
136 | # DotCover is a Code Coverage Tool
137 | *.dotCover
138 |
139 | # AxoCover is a Code Coverage Tool
140 | .axoCover/*
141 | !.axoCover/settings.json
142 |
143 | # Visual Studio code coverage results
144 | *.coverage
145 | *.coveragexml
146 |
147 | # NCrunch
148 | _NCrunch_*
149 | .*crunch*.local.xml
150 | nCrunchTemp_*
151 |
152 | # MightyMoose
153 | *.mm.*
154 | AutoTest.Net/
155 |
156 | # Web workbench (sass)
157 | .sass-cache/
158 |
159 | # Installshield output folder
160 | [Ee]xpress/
161 |
162 | # DocProject is a documentation generator add-in
163 | DocProject/buildhelp/
164 | DocProject/Help/*.HxT
165 | DocProject/Help/*.HxC
166 | DocProject/Help/*.hhc
167 | DocProject/Help/*.hhk
168 | DocProject/Help/*.hhp
169 | DocProject/Help/Html2
170 | DocProject/Help/html
171 |
172 | # Click-Once directory
173 | publish/
174 |
175 | # Publish Web Output
176 | *.[Pp]ublish.xml
177 | *.azurePubxml
178 | # Note: Comment the next line if you want to checkin your web deploy settings,
179 | # but database connection strings (with potential passwords) will be unencrypted
180 | *.pubxml
181 | *.publishproj
182 |
183 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
184 | # checkin your Azure Web App publish settings, but sensitive information contained
185 | # in these scripts will be unencrypted
186 | PublishScripts/
187 |
188 | # NuGet Packages
189 | *.nupkg
190 | # NuGet Symbol Packages
191 | *.snupkg
192 | # The packages folder can be ignored because of Package Restore
193 | **/[Pp]ackages/*
194 | # except build/, which is used as an MSBuild target.
195 | !**/[Pp]ackages/build/
196 | # Uncomment if necessary however generally it will be regenerated when needed
197 | #!**/[Pp]ackages/repositories.config
198 | # NuGet v3's project.json files produces more ignorable files
199 | *.nuget.props
200 | *.nuget.targets
201 |
202 | # Microsoft Azure Build Output
203 | csx/
204 | *.build.csdef
205 |
206 | # Microsoft Azure Emulator
207 | ecf/
208 | rcf/
209 |
210 | # Windows Store app package directories and files
211 | AppPackages/
212 | BundleArtifacts/
213 | Package.StoreAssociation.xml
214 | _pkginfo.txt
215 | *.appx
216 | *.appxbundle
217 | *.appxupload
218 |
219 | # Visual Studio cache files
220 | # files ending in .cache can be ignored
221 | *.[Cc]ache
222 | # but keep track of directories ending in .cache
223 | !?*.[Cc]ache/
224 |
225 | # Others
226 | ClientBin/
227 | ~$*
228 | *~
229 | *.dbmdl
230 | *.dbproj.schemaview
231 | *.jfm
232 | *.pfx
233 | *.publishsettings
234 | orleans.codegen.cs
235 |
236 | # Including strong name files can present a security risk
237 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
238 | #*.snk
239 |
240 | # Since there are multiple workflows, uncomment next line to ignore bower_components
241 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
242 | #bower_components/
243 |
244 | # RIA/Silverlight projects
245 | Generated_Code/
246 |
247 | # Backup & report files from converting an old project file
248 | # to a newer Visual Studio version. Backup files are not needed,
249 | # because we have git ;-)
250 | _UpgradeReport_Files/
251 | Backup*/
252 | UpgradeLog*.XML
253 | UpgradeLog*.htm
254 | ServiceFabricBackup/
255 | *.rptproj.bak
256 |
257 | # SQL Server files
258 | *.mdf
259 | *.ldf
260 | *.ndf
261 |
262 | # Business Intelligence projects
263 | *.rdl.data
264 | *.bim.layout
265 | *.bim_*.settings
266 | *.rptproj.rsuser
267 | *- [Bb]ackup.rdl
268 | *- [Bb]ackup ([0-9]).rdl
269 | *- [Bb]ackup ([0-9][0-9]).rdl
270 |
271 | # Microsoft Fakes
272 | FakesAssemblies/
273 |
274 | # GhostDoc plugin setting file
275 | *.GhostDoc.xml
276 |
277 | # Node.js Tools for Visual Studio
278 | .ntvs_analysis.dat
279 | node_modules/
280 |
281 | # Visual Studio 6 build log
282 | *.plg
283 |
284 | # Visual Studio 6 workspace options file
285 | *.opt
286 |
287 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
288 | *.vbw
289 |
290 | # Visual Studio LightSwitch build output
291 | **/*.HTMLClient/GeneratedArtifacts
292 | **/*.DesktopClient/GeneratedArtifacts
293 | **/*.DesktopClient/ModelManifest.xml
294 | **/*.Server/GeneratedArtifacts
295 | **/*.Server/ModelManifest.xml
296 | _Pvt_Extensions
297 |
298 | # Paket dependency manager
299 | .paket/paket.exe
300 | paket-files/
301 |
302 | # FAKE - F# Make
303 | .fake/
304 |
305 | # CodeRush personal settings
306 | .cr/personal
307 |
308 | # Python Tools for Visual Studio (PTVS)
309 | __pycache__/
310 | *.pyc
311 |
312 | # Cake - Uncomment if you are using it
313 | # tools/**
314 | # !tools/packages.config
315 |
316 | # Tabs Studio
317 | *.tss
318 |
319 | # Telerik's JustMock configuration file
320 | *.jmconfig
321 |
322 | # BizTalk build output
323 | *.btp.cs
324 | *.btm.cs
325 | *.odx.cs
326 | *.xsd.cs
327 |
328 | # OpenCover UI analysis results
329 | OpenCover/
330 |
331 | # Azure Stream Analytics local run output
332 | ASALocalRun/
333 |
334 | # MSBuild Binary and Structured Log
335 | *.binlog
336 |
337 | # NVidia Nsight GPU debugger configuration file
338 | *.nvuser
339 |
340 | # MFractors (Xamarin productivity tool) working folder
341 | .mfractor/
342 |
343 | # Local History for Visual Studio
344 | .localhistory/
345 |
346 | # BeatPulse healthcheck temp database
347 | healthchecksdb
348 |
349 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
350 | MigrationBackup/
351 |
352 | # Ionide (cross platform F# VS Code tools) working folder
353 | .ionide/
354 |
355 | # Xamarin
356 | Resource.designer.cs
357 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | ###############################
2 | # Core EditorConfig Options #
3 | ###############################
4 |
5 | root = true
6 |
7 | # All files
8 | [*]
9 | charset = utf-8
10 | trim_trailing_whitespace = true
11 |
12 | # MSBuild
13 | [*.{csproj,proj,projitems,shproj,fsproj,targets,props}]
14 | indent_style = space
15 | indent_size = 2
16 |
17 | # XML config files
18 | [*.{xml,axml,xaml,config,nuspec,resx}]
19 | indent_style = space
20 | indent_size = 2
21 |
22 | # RESX files
23 | [*.resx]
24 | trim_trailing_whitespace = false
25 |
26 | # JSON files
27 | [*.json]
28 | indent_style = space
29 | indent_size = 2
30 |
31 | # F# files
32 | [*.{fs, fsx, fsi}]
33 | indent_style = space
34 | indent_size = 4
35 |
36 | # Code files
37 | [*.{cs,csx,vb,vbx}]
38 | insert_final_newline = true
39 | indent_style = tab
40 | tab_width = 8
41 | indent_size = 8
42 | max_line_length = 180
43 |
44 | ###############################
45 | # .NET Coding Conventions #
46 | ###############################
47 |
48 | [*.{cs,vb}]
49 | # Organize usings
50 | dotnet_sort_system_directives_first = true
51 | dotnet_separate_import_directive_groups = false
52 |
53 | # Avoid "this." and "Me." if not necessary
54 | dotnet_style_qualification_for_field = false:suggestion
55 | dotnet_style_qualification_for_property = false:suggestion
56 | dotnet_style_qualification_for_method = false:suggestion
57 | dotnet_style_qualification_for_event = false:suggestion
58 |
59 | # Use language keywords instead of framework type names for type references
60 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
61 | dotnet_style_predefined_type_for_member_access = true:suggestion
62 |
63 | # Suggest more modern language features when available
64 | dotnet_style_object_initializer = true:suggestion
65 | dotnet_style_collection_initializer = true:suggestion
66 | dotnet_style_coalesce_expression = true:suggestion
67 | dotnet_style_null_propagation = true:suggestion
68 | dotnet_style_explicit_tuple_names = true:suggestion
69 |
70 | # Parentheses preferences
71 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
72 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
73 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
74 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
75 |
76 | # Avoid redundant accessibility modifiers when they're default
77 | dotnet_style_require_accessibility_modifiers = omit_if_default:suggestion
78 | dotnet_style_readonly_field = true:suggestion
79 |
80 | # Expression-level preferences
81 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
82 | dotnet_style_prefer_inferred_tuple_names = true:suggestion
83 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
84 | dotnet_style_prefer_auto_properties = true:silent
85 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent
86 | dotnet_style_prefer_conditional_expression_over_return = true:silent
87 |
88 | ###############################
89 | # Naming Conventions #
90 | ###############################
91 |
92 | # Style Definitions
93 | dotnet_naming_style.pascal_case_style.capitalization = pascal_case
94 |
95 | dotnet_naming_style.underline_separator.word_separator = _
96 | dotnet_naming_style.underline_separator.capitalization = all_lower
97 |
98 | # Symbol Definitions
99 | dotnet_naming_symbols.parameters.applicable_kinds = parameter
100 | dotnet_naming_symbols.parameters.applicable_accessibilities = *
101 |
102 | dotnet_naming_symbols.fields.applicable_kinds = field
103 |
104 | dotnet_naming_symbols.constant_fields.applicable_kinds = field
105 | dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
106 | dotnet_naming_symbols.constant_fields.required_modifiers = const
107 |
108 | # Use CamelCase for parameters
109 | dotnet_naming_rule.method_parameters_should_be_camel_case.severity = suggestion
110 | dotnet_naming_rule.method_parameters_should_be_camel_case.symbols = parameters
111 | dotnet_naming_rule.method_parameters_should_be_camel_case.style = camel_case
112 |
113 | # Use PascalCase for constant fields
114 | dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
115 | dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
116 | dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
117 |
118 | # Use underline separator for instance fields
119 | dotnet_naming_rule.fields_should_be_underline_separator.severity = suggestion
120 | dotnet_naming_rule.fields_should_be_underline_separator.symbols = fields
121 | dotnet_naming_rule.fields_should_be_underline_separator.style = underline_separator
122 |
123 |
124 | ###############################
125 | # C# Code Style Rules #
126 | ###############################
127 |
128 | [*.cs]
129 | # var preferences
130 | csharp_style_var_for_built_in_types = true:silent
131 | csharp_style_var_when_type_is_apparent = true:silent
132 | csharp_style_var_elsewhere = true:silent
133 |
134 | # Expression-bodied members
135 | csharp_style_expression_bodied_methods = false:silent
136 | csharp_style_expression_bodied_constructors = false:silent
137 | csharp_style_expression_bodied_operators = false:silent
138 | csharp_style_expression_bodied_properties = true:silent
139 | csharp_style_expression_bodied_indexers = true:silent
140 | csharp_style_expression_bodied_accessors = true:silent
141 |
142 | # Pattern-matching preferences
143 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
144 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
145 |
146 | # Null-checking preferences
147 | csharp_style_throw_expression = true:suggestion
148 | csharp_style_conditional_delegate_call = true:suggestion
149 |
150 | # Modifier preferences
151 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
152 |
153 | # Expression-level preferences
154 | csharp_prefer_braces = true:silent
155 | csharp_style_deconstructed_variable_declaration = true:suggestion
156 | csharp_prefer_simple_default_expression = true:suggestion
157 | csharp_style_pattern_local_over_anonymous_function = true:suggestion
158 | csharp_style_inlined_variable_declaration = true:suggestion
159 |
160 | ###############################
161 | # C# Formatting Rules #
162 | ###############################
163 |
164 | # Newline settings
165 | csharp_new_line_before_open_brace = methods,types
166 | csharp_new_line_before_else = false
167 | csharp_new_line_before_catch = false
168 | csharp_new_line_before_finally = false
169 | csharp_new_line_before_members_in_object_initializers = true
170 | csharp_new_line_before_members_in_anonymous_types = true
171 |
172 | # Indentation preferences
173 | csharp_indent_switch_labels = false
174 | csharp_indent_case_contents = true
175 | csharp_indent_switch_labels = true
176 |
177 | # Space preferences
178 | csharp_space_after_cast = true
179 | csharp_space_after_keywords_in_control_flow_statements = true
180 | csharp_space_between_method_call_parameter_list_parentheses = false
181 | csharp_space_between_method_declaration_parameter_list_parentheses = false
182 | csharp_space_between_parentheses = false
183 | csharp_space_before_colon_in_inheritance_clause = true
184 | csharp_space_after_colon_in_inheritance_clause = true
185 | csharp_space_around_binary_operators = before_and_after
186 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
187 | csharp_space_between_method_call_name_and_opening_parenthesis = true
188 | csharp_space_between_method_call_empty_parameter_list_parentheses = false
189 | csharp_space_between_method_declaration_name_and_open_parenthesis = true
190 | csharp_space_after_keywords_in_control_flow_statements = true
191 | csharp_space_before_open_square_brackets = true
192 |
193 | # Wrapping preferences
194 | csharp_preserve_single_line_statements = true
195 | csharp_preserve_single_line_blocks = true
196 |
197 | ##################################
198 | # Visual Basic Code Style Rules #
199 | ##################################
200 |
201 | [*.vb]
202 | # Modifier preferences
203 | visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
204 |
--------------------------------------------------------------------------------