-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Add a performance test using BenchmarkDotNet.
- Loading branch information
1 parent
add11fb
commit 5448fbe
Showing
32 changed files
with
1,657 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using AppKit; | ||
using Foundation; | ||
|
||
namespace MyCocoaApp { | ||
[Register ("AppDelegate")] | ||
public class AppDelegate : NSApplicationDelegate { | ||
public AppDelegate () | ||
{ | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions
68
tests/perftest/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"images": [ | ||
{ | ||
"filename": "AppIcon-16.png", | ||
"size": "16x16", | ||
"scale": "1x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-16@2x.png", | ||
"size": "16x16", | ||
"scale": "2x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-32.png", | ||
"size": "32x32", | ||
"scale": "1x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-32@2x.png", | ||
"size": "32x32", | ||
"scale": "2x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-128.png", | ||
"size": "128x128", | ||
"scale": "1x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-128@2x.png", | ||
"size": "128x128", | ||
"scale": "2x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-256.png", | ||
"size": "256x256", | ||
"scale": "1x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-256@2x.png", | ||
"size": "256x256", | ||
"scale": "2x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-512.png", | ||
"size": "512x512", | ||
"scale": "1x", | ||
"idiom": "mac" | ||
}, | ||
{ | ||
"filename": "AppIcon-512@2x.png", | ||
"size": "512x512", | ||
"scale": "2x", | ||
"idiom": "mac" | ||
} | ||
], | ||
"info": { | ||
"version": 1, | ||
"author": "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleName</key> | ||
<string>MyCocoaApp</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.xamarin.MyCocoaApp</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.15</string> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>${AuthorCopyright:HtmlEncode}</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
<key>NSMainStoryboardFile</key> | ||
<string>Main</string> | ||
<key>XSAppIconAssets</key> | ||
<string>Assets.xcassets/AppIcon.appiconset</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
using System.Linq; | ||
|
||
using AppKit; | ||
using BenchmarkDotNet.Columns; | ||
using BenchmarkDotNet.Configs; | ||
using BenchmarkDotNet.Exporters.Csv; | ||
using BenchmarkDotNet.Exporters.Json; | ||
using BenchmarkDotNet.Jobs; | ||
using BenchmarkDotNet.Reports; | ||
using BenchmarkDotNet.Running; | ||
using BenchmarkDotNet.Toolchains.InProcess.Emit; | ||
using Perfolizer.Horology; | ||
|
||
namespace PerfTest { | ||
static class MainClass { | ||
static int Main (string [] args) | ||
{ | ||
try { | ||
// The call to NSApplication.Init is required | ||
NSApplication.Init (); | ||
BenchmarkRunner.Run (typeof (MainClass).Assembly, new Config ()); | ||
} catch (Exception e) { | ||
Console.WriteLine ("Unhandled exception: {0}", e); | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
public class Config : ManualConfig { | ||
public Config () | ||
{ | ||
AddJob (Job.ShortRun | ||
.WithLaunchCount (1) | ||
.WithToolchain (new InProcessEmitToolchain (TimeSpan.FromHours (1), true)) | ||
.WithId ("InProcess") | ||
); | ||
|
||
var artifactsPath = Environment.GetEnvironmentVariable ("BENCHMARK_OUTPUT_PATH"); | ||
if (!string.IsNullOrEmpty (artifactsPath)) | ||
WithArtifactsPath (artifactsPath); | ||
|
||
WithOption (ConfigOptions.DisableOptimizationsValidator, true); | ||
WithOption (ConfigOptions.JoinSummary, true); | ||
|
||
AddLogger (DefaultConfig.Instance.GetLoggers ().ToArray ()); // manual config has no loggers by default | ||
AddExporter (DefaultConfig.Instance.GetExporters ().Where (v => !(v is CsvExporter)).ToArray ()); // manual config has no exporters by default | ||
|
||
var csv = new CsvExporter ( | ||
CsvSeparator.Semicolon, | ||
new SummaryStyle (CultureInfo.CurrentCulture, true, SizeUnit.B, TimeUnit.Nanosecond, false, true) | ||
); | ||
AddExporter (csv); | ||
AddExporter (JsonExporter.Full); | ||
|
||
AddColumnProvider (DefaultConfig.Instance.GetColumnProviders ().ToArray ()); // manual config has no columns by default | ||
} | ||
} | ||
} |
Oops, something went wrong.