* 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:
Ujjwal Chadha 2022-01-14 11:36:02 -08:00 коммит произвёл GitHub
Родитель e6379fadee
Коммит d448f7cf94
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -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; };