Skip to content

Commit

Permalink
Add fast abi composable benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalchadha committed Feb 17, 2022
1 parent 3f06f06 commit 3fb3477
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Benchmarks/Benchmarks.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
name="BenchmarkComponent.ClassWithFastAbi"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="BenchmarkComponent.ClassWithFastAbiDerived"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>

</assembly>
54 changes: 54 additions & 0 deletions src/Benchmarks/QueryInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class QueryInterfacePerf
ManagedObjectWithInterfaces managedObject;
ManagedComposableObjectWithInterfaces composableObject;
ClassWithFastAbi fastAbiInstance;
ClassWithFastAbiDerived fastAbiDerivedInstance;

[GlobalSetup]
public void Setup()
Expand All @@ -37,6 +38,7 @@ public void Setup()
managedObject = new ManagedObjectWithInterfaces();
composableObject = new ManagedComposableObjectWithInterfaces();
fastAbiInstance = new ClassWithFastAbi();
fastAbiDerivedInstance = new ClassWithFastAbiDerived();
}

[Benchmark]
Expand All @@ -63,6 +65,30 @@ public int QueryFastAbiNonDefaultInterface()
return fastAbiInstance.NonDefaultIntProperty;
}

[Benchmark]
public int QueryFastAbiDerivedDefaultInterface()
{
return fastAbiDerivedInstance.DerivedDefaultIntProperty;
}

[Benchmark]
public int QueryFastAbiComposedNonDefaultInterface()
{
return fastAbiDerivedInstance.DerivedNonDefaultIntProperty;
}

[Benchmark]
public int QueryFastAbiComposedBaseDefaultInterface()
{
return fastAbiDerivedInstance.DefaultIntProperty;
}

[Benchmark]
public int QueryFastAbiComposedBaseNonDefaultInterface()
{
return fastAbiDerivedInstance.NonDefaultIntProperty;
}

[Benchmark]
public bool QueryNonDefaultInterface2()
{
Expand Down Expand Up @@ -144,6 +170,34 @@ public int ConstructAndQueryFastAbiNonDefaultInterfaceFirstCall()
return instance2.NonDefaultIntProperty;
}

[Benchmark]
public int ConstructAndQueryFastAbiDerivedDefaultInterfaceFirstCall()
{
var instance2 = new ClassWithFastAbiDerived();
return instance2.DerivedDefaultIntProperty;
}

[Benchmark]
public int ConstructAndQueryFastAbiDerivedNonDefaultInterfaceFirstCall()
{
var instance2 = new ClassWithFastAbiDerived();
return instance2.DerivedNonDefaultIntProperty;
}

[Benchmark]
public int ConstructAndQueryFastAbiDerivedBaseDefaultInterfaceFirstCall()
{
var instance2 = new ClassWithFastAbiDerived();
return instance2.DefaultIntProperty;
}

[Benchmark]
public int ConstructAndQueryFastAbiDerivedBaseNonDefaultInterfaceFirstCall()
{
var instance2 = new ClassWithFastAbiDerived();
return instance2.NonDefaultIntProperty;
}

[Benchmark]
public int StaticPropertyCall()
{
Expand Down
2 changes: 1 addition & 1 deletion src/get_testwinrt.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ git checkout -f master
if ErrorLevel 1 popd & exit /b !ErrorLevel!
git fetch -f
if ErrorLevel 1 popd & exit /b !ErrorLevel!
git reset -q --hard 6573bf54bd4e4349272b5e30a0f526c4dfe1f535
git reset -q --hard 761842f968d4f9b661653cce9e26534be11174fb
if ErrorLevel 1 popd & exit /b !ErrorLevel!
echo Restoring Nuget
%this_dir%.nuget\nuget.exe restore
Expand Down

0 comments on commit 3fb3477

Please sign in to comment.