зеркало из https://github.com/microsoft/TestWinRT.git
Add IVector benchmark (#59)
* Add IVector benchmark * Add boxing benchmarks (#58) * Add some benchmarks for IReference / nullable. * Add some more delegate benchmarks. * Fix merge error Co-authored-by: Manodasan Wignarajah <mawign@microsoft.com>
This commit is contained in:
Родитель
e6379fadee
Коммит
d448f7cf94
|
@ -91,12 +91,19 @@ namespace winrt::BenchmarkComponent::implementation
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Windows::Foundation::Collections::IVector<winrt::hstring> createList()
|
||||||
|
{
|
||||||
|
std::vector<winrt::hstring> list;
|
||||||
|
return winrt::single_threaded_vector(std::move(list));
|
||||||
|
}
|
||||||
|
|
||||||
ClassWithMarshalingRoutines::ClassWithMarshalingRoutines()
|
ClassWithMarshalingRoutines::ClassWithMarshalingRoutines()
|
||||||
{
|
{
|
||||||
keyValuePairObject = createKeyValuePairObject();
|
keyValuePairObject = createKeyValuePairObject();
|
||||||
arrayObject = createArrayObject();
|
arrayObject = createArrayObject();
|
||||||
nullableObject = createNullableObject();
|
nullableObject = createNullableObject();
|
||||||
dictionary = createDictionary();
|
dictionary = createDictionary();
|
||||||
|
list = createList();
|
||||||
}
|
}
|
||||||
|
|
||||||
hstring ClassWithMarshalingRoutines::DefaultStringProperty()
|
hstring ClassWithMarshalingRoutines::DefaultStringProperty()
|
||||||
|
@ -139,6 +146,11 @@ namespace winrt::BenchmarkComponent::implementation
|
||||||
return dictionary;
|
return dictionary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Windows::Foundation::Collections::IVector<winrt::hstring> ClassWithMarshalingRoutines::NewList()
|
||||||
|
{
|
||||||
|
return createList();
|
||||||
|
}
|
||||||
|
|
||||||
Windows::Foundation::IInspectable ClassWithMarshalingRoutines::NewTypeErasedKeyValuePairObject()
|
Windows::Foundation::IInspectable ClassWithMarshalingRoutines::NewTypeErasedKeyValuePairObject()
|
||||||
{
|
{
|
||||||
return createKeyValuePairObject();
|
return createKeyValuePairObject();
|
||||||
|
|
|
@ -53,6 +53,7 @@ namespace winrt::BenchmarkComponent::implementation
|
||||||
Windows::Foundation::IReference<INT32> nullableObject;
|
Windows::Foundation::IReference<INT32> nullableObject;
|
||||||
Windows::Foundation::IReferenceArray<int> arrayObject;
|
Windows::Foundation::IReferenceArray<int> arrayObject;
|
||||||
Windows::Foundation::Collections::IMap<hstring, BenchmarkComponent::WrappedClass> dictionary;
|
Windows::Foundation::Collections::IMap<hstring, BenchmarkComponent::WrappedClass> dictionary;
|
||||||
|
Windows::Foundation::Collections::IVector<winrt::hstring> list;
|
||||||
|
|
||||||
Windows::Foundation::Collections::IKeyValuePair<hstring, IInspectable> createKeyValuePairObject();
|
Windows::Foundation::Collections::IKeyValuePair<hstring, IInspectable> createKeyValuePairObject();
|
||||||
Windows::Foundation::IReference<INT32> createNullableObject();
|
Windows::Foundation::IReference<INT32> createNullableObject();
|
||||||
|
@ -92,6 +93,8 @@ namespace winrt::BenchmarkComponent::implementation
|
||||||
BenchmarkComponent::WrappedClass NewWrappedClassObject();
|
BenchmarkComponent::WrappedClass NewWrappedClassObject();
|
||||||
void NewWrappedClassObject(BenchmarkComponent::WrappedClass val);
|
void NewWrappedClassObject(BenchmarkComponent::WrappedClass val);
|
||||||
|
|
||||||
|
Windows::Foundation::Collections::IVector<winrt::hstring> NewList();
|
||||||
|
|
||||||
int32_t IntProperty();
|
int32_t IntProperty();
|
||||||
void IntProperty(int32_t value);
|
void IntProperty(int32_t value);
|
||||||
winrt::event_token IntPropertyChanged(Windows::Foundation::EventHandler<int32_t> const& handler);
|
winrt::event_token IntPropertyChanged(Windows::Foundation::EventHandler<int32_t> const& handler);
|
||||||
|
|
|
@ -90,6 +90,7 @@ namespace BenchmarkComponent
|
||||||
void CallForInt(ProvideInt provideInt);
|
void CallForInt(ProvideInt provideInt);
|
||||||
|
|
||||||
Windows.Foundation.Collections.IMap<String, WrappedClass> ExistingDictionary{ get; };
|
Windows.Foundation.Collections.IMap<String, WrappedClass> ExistingDictionary{ get; };
|
||||||
|
Windows.Foundation.Collections.IVector<String> NewList();
|
||||||
|
|
||||||
Windows.Foundation.IReference<Int32> NullableInt{ get; set; };
|
Windows.Foundation.IReference<Int32> NullableInt{ get; set; };
|
||||||
Windows.Foundation.IReference<BlittableStruct> NullableBlittableStruct{ get; set; };
|
Windows.Foundation.IReference<BlittableStruct> NullableBlittableStruct{ get; set; };
|
||||||
|
|
Загрузка…
Ссылка в новой задаче