-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45cfd16
commit cb424e5
Showing
8 changed files
with
121 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Buffers; | ||
using System.IO; | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Diagnostics.Windows.Configs; | ||
using BenchmarkDotNet.Jobs; | ||
|
||
namespace SkiaSharp.Benchmarks; | ||
|
||
[EtwProfiler] | ||
// [NativeMemoryProfiler] | ||
[MemoryDiagnoser] | ||
// [SimpleJob(RuntimeMoniker.Mono)] | ||
// [SimpleJob(RuntimeMoniker.Net472)] | ||
// [SimpleJob(RuntimeMoniker.NetCoreApp31)] | ||
[SimpleJob(RuntimeMoniker.Net60)] | ||
public class Benchmark | ||
{ | ||
[GlobalSetup] | ||
public void GlobalSetup() | ||
{ | ||
|
||
} | ||
|
||
[Benchmark] | ||
public void TheBenchmark() | ||
{ | ||
|
||
} | ||
} |
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 |
---|---|---|
@@ -1,32 +1,11 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Jobs; | ||
using BenchmarkDotNet.Running; | ||
using BenchmarkDotNet.Running; | ||
|
||
namespace SkiaSharp.Benchmarks | ||
{ | ||
//[SimpleJob(RuntimeMoniker.CoreRt31)] | ||
[SimpleJob(RuntimeMoniker.Mono)] | ||
[SimpleJob(RuntimeMoniker.Net472)] | ||
[SimpleJob(RuntimeMoniker.NetCoreApp31)] | ||
public class Benchmark | ||
{ | ||
public Benchmark() | ||
{ | ||
// setup | ||
} | ||
namespace SkiaSharp.Benchmarks; | ||
|
||
[Benchmark] | ||
public void TheBenchmark() | ||
{ | ||
// benchmark | ||
} | ||
} | ||
|
||
public class Program | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var summary = BenchmarkRunner.Run<Benchmark>(); | ||
} | ||
var summary = BenchmarkRunner.Run<Benchmark>(); | ||
} | ||
} |
36 changes: 18 additions & 18 deletions
36
benchmarks/SkiaSharp.Benchmarks/SkiaSharp.Benchmarks.csproj
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 |
---|---|---|
@@ -1,37 +1,37 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks> | ||
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks> | ||
<RootNamespace>SkiaSharp.Benchmarks</RootNamespace> | ||
<AssemblyName>SkiaSharp.Benchmarks</AssemblyName> | ||
<SkipGenerateAssemblyVersionInfo>true</SkipGenerateAssemblyVersionInfo> | ||
<SkipMDocGenerateDocs>true</SkipMDocGenerateDocs> | ||
<SkipCopyToOutputDirectory>true</SkipCopyToOutputDirectory> | ||
<DebugType>pdbonly</DebugType> | ||
<DebugSymbols>true</DebugSymbols> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" /> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" /> | ||
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.1" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\binding\HarfBuzzSharp\HarfBuzzSharp.csproj" /> | ||
<ProjectReference Include="..\..\binding\SkiaSharp.SceneGraph\SkiaSharp.SceneGraph.csproj" /> | ||
<ProjectReference Include="..\..\binding\SkiaSharp.Skottie\SkiaSharp.Skottie.csproj" /> | ||
<ProjectReference Include="..\..\binding\SkiaSharp\SkiaSharp.csproj" /> | ||
<ProjectReference Include="..\..\source\SkiaSharp.HarfBuzz\SkiaSharp.HarfBuzz\SkiaSharp.HarfBuzz.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="..\..\output\native\windows\x64\libSkiaSharp.dll" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\windows\x64\libSkiaSharp.dll') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libSkiaSharp.pdb" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\windows\x64\libSkiaSharp.pdb') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libHarfBuzzSharp.dll" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\windows\x64\libHarfBuzzSharp.dll') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libHarfBuzzSharp.pdb" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\windows\x64\libHarfBuzzSharp.pdb') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\osx\libSkiaSharp.dylib" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\osx\libSkiaSharp.dylib') or '$(IsMacOS)' == 'true' " /> | ||
<Content Include="..\..\output\native\osx\libHarfBuzzSharp.dylib" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\osx\libHarfBuzzSharp.dylib') or '$(IsMacOS)' == 'true' " /> | ||
<Content Include="..\..\output\native\linux\x64\libSkiaSharp.so" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\linux\x64\libSkiaSharp.so') or '$(IsLinux)' == 'true' " /> | ||
<Content Include="..\..\output\native\linux\x64\libHarfBuzzSharp.so" CopyToOutputDirectory="Always" Visible="false" | ||
Condition=" Exists('..\..\output\native\linux\x64\libHarfBuzzSharp.so') or '$(IsLinux)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libSkiaSharp.dll" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\windows\x64\libSkiaSharp.dll') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libSkiaSharp.pdb" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\windows\x64\libSkiaSharp.pdb') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libHarfBuzzSharp.dll" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\windows\x64\libHarfBuzzSharp.dll') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\windows\x64\libHarfBuzzSharp.pdb" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\windows\x64\libHarfBuzzSharp.pdb') or '$(IsWindows)' == 'true' " /> | ||
<Content Include="..\..\output\native\osx\libSkiaSharp.dylib" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\osx\libSkiaSharp.dylib') or '$(IsMacOS)' == 'true' " /> | ||
<Content Include="..\..\output\native\osx\libHarfBuzzSharp.dylib" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\osx\libHarfBuzzSharp.dylib') or '$(IsMacOS)' == 'true' " /> | ||
<Content Include="..\..\output\native\linux\x64\libSkiaSharp.so" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\linux\x64\libSkiaSharp.so') or '$(IsLinux)' == 'true' " /> | ||
<Content Include="..\..\output\native\linux\x64\libHarfBuzzSharp.so" CopyToOutputDirectory="Always" Visible="false" Condition=" Exists('..\..\output\native\linux\x64\libHarfBuzzSharp.so') or '$(IsLinux)' == 'true' " /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Remove="BenchmarkDotNet.Artifacts/**" /> | ||
</ItemGroup> | ||
</Project> |
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
39 changes: 39 additions & 0 deletions
39
benchmarks/SkiaSharp.Benchmarks/Utils/NonSeekableReadOnlyStream.cs
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,39 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace SkiaSharp.Benchmarks; | ||
|
||
public class NonSeekableReadOnlyStream : Stream | ||
{ | ||
private readonly Stream stream; | ||
|
||
public NonSeekableReadOnlyStream(Stream stream) | ||
{ | ||
this.stream = stream; | ||
} | ||
|
||
public override bool CanRead => stream.CanRead; | ||
|
||
public override bool CanSeek => false; | ||
|
||
public override bool CanWrite => false; | ||
|
||
public override long Length => throw new NotSupportedException(); | ||
|
||
public override long Position | ||
{ | ||
get => stream.Position; | ||
set => throw new NotSupportedException(); | ||
} | ||
|
||
public override void Flush() => throw new NotSupportedException(); | ||
|
||
public override int Read(byte[] buffer, int offset, int count) => | ||
stream.Read(buffer, offset, count); | ||
|
||
public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); | ||
|
||
public override void SetLength(long value) => throw new NotSupportedException(); | ||
|
||
public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); | ||
} |
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