Содержание
- 3. О себе Зарабатываю на жизнь программированием с 2005 года Программировал еще на .net framework 1.0 Помню
- 4. “ЗОЧЕМ? Есть же ?”
- 5. Варианты Protocol Buffers Json Newtonsoft.Json System.Text.Json etc BinaryFormatter XmlFormatter другие
- 6. Причины
- 7. Причины Экзотические форматы
- 8. Причины Экзотические форматы Лучшая производительность
- 9. Причины Экзотические форматы Лучшая производительность Другие сценарии использования Reflection: Data-binding Object-object mapping Логирование: Destructing
- 10. О докладе Доступ к данным: Reflection и альтернативы Производительность различных способов доступа Участие доступа к данным
- 11. Прямой доступ vs. Reflection
- 13. System.Reflection System.Object GetType()
- 14. System.Reflection System.Object GetType() System.Type GetProperties(...)
- 15. System.Reflection System.Object GetType() System.Type GetProperties(...) System.Reflection.PropertyInfo Name PropertyType GetValue/SetValue
- 16. “Все знают, что Reflection это Медленно!!!”
- 17. Type System Overview
- 18. Насколько Reflection это медленно?
- 19. Цифры
- 28. Ba Dum Tss!
- 29. Ba Dum Tss!
- 30. “Давай закэшируем PropertyInfo!”
- 32. Cached PropertyInfo
- 33. Cached PropertyInfo
- 35. “Неужели нет другого способа?!”
- 37. FastMember
- 38. FastMember
- 39. FastMember
- 42. “Безнадёга?”
- 43. Delegate.CreateDelegate
- 44. Delegate Открытые / Закрытые
- 45. Delegate: открытые/закрытые
- 46. Delegate: открытые/закрытые
- 47. Delegate: открытые/закрытые
- 48. Delegate.CreateDelegate
- 49. Delegate.CreateDelegate
- 50. PropertyInfo ➝ MethodInfo
- 51. PropertyInfo ➝ MethodInfo GetGetMethod() / GetSetMethod()
- 52. Delegate.CreateDelegate
- 53. Delegate.CreateDelegate
- 54. Delegate.CreateDelegate
- 55. Delegate.CreateDelegate
- 56. Delegate.CreateDelegate
- 57. Delegate.CreateDelegate
- 60. “А может генерировать код в runtime?”
- 61. Генерация кода в runtime
- 62. Генерация кода в runtime IL Emit
- 63. Генерация кода в runtime IL Emit Compiled Expression Trees
- 64. IL Emit
- 65. Intermediate Language
- 67. public string GetViaProperty() => _test.StringProperty;
- 68. .method private hidebysig static string GetViaProperty( class Test target) cil managed { .maxstack 1 ldarg.0 callvirt
- 69. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 70. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 71. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 72. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 73. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 74. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 75. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 76. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 77. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 78. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 79. public static Func GenerateGetter (PropertyInfo property) { var method = new DynamicMethod(property.Name + "GetterTyped", typeof(TParam), new[]
- 80. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 81. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 82. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 83. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 84. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 85. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 86. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 87. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 88. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 89. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 90. static Action GenerateSetter (PropertyInfo propertyInfo) { var method = new DynamicMethod(propertyInfo.Name + "SetterTyped", null, new[] {
- 91. Intermediate Language
- 92. Intermediate Language
- 93. Intermediate Language
- 94. Compiled Expression Trees
- 95. Expression Trees
- 96. Expression Trees Lambda Expressions
- 97. Expression Trees Lambda Expressions API
- 98. Expression Trees: Lambda
- 99. Expression Trees: Lambda
- 100. Expression Trees: API
- 115. Expression Trees: API
- 116. Expression Trees: API
- 117. Expression Trees: API
- 118. Expression Trees: API
- 121. Ни рефлексией единой Reflection - медленно
- 122. Ни рефлексией единой Reflection - медленно Альтернативы “из коробки” - быстрее
- 123. Ни рефлексией единой Reflection - медленно Альтернативы “из коробки” - быстрее Требуют усилий
- 124. “Погоди! Но ...”
- 125. “Делегаты специфицированы конкретными типами целевого объекта и его свойства!”
- 129. PropertyInfo.GetValue
- 130. Delegate.CreateDelegate
- 131. Delegate.CreateDelegate
- 132. System.ArgumentException Cannot bind to the target method because its signature is not compatible with that of
- 133. “Эх! А счастье было так близко...”
- 134. Delegate (object, object)
- 135. Delegate (object, object)
- 136. Delegate (object, object)
- 137. Delegate (object, object)
- 138. Delegate (object, object)
- 139. Delegate (object, object)
- 140. Delegate (object, object)
- 141. Delegate (object, object)
- 142. Delegate (object, object)
- 144. Delegate (object, object)
- 145. Delegate (object, object)
- 146. ILGen (object, object)
- 147. ILGen (object, object)
- 148. ILGen (object, object)
- 149. ILGen (object, object)
- 150. ILGen (object, object)
- 151. ILGen (object, object)
- 152. Expression Trees (object, object)
- 153. Expression Trees (object, object)
- 154. Expression Trees (object, object)
- 155. Expression Trees (object, object)
- 156. Expression Trees (object, object)
- 159. Ни рефлексией единой Reflection - медленно
- 160. Ни рефлексией единой Reflection - медленно Нетипизированный доступ
- 161. Ни рефлексией единой Reflection - медленно Нетипизированный доступ Альтернативы “из коробки” - быстрее
- 162. Ни рефлексией единой Reflection - медленно Нетипизированный доступ Альтернативы “из коробки” - быстрее Типизированный доступ
- 163. Ни рефлексией единой Reflection - медленно Нетипизированный доступ Альтернативы “из коробки” - быстрее Типизированный доступ Reflection-like
- 164. Ни рефлексией единой Reflection - медленно Нетипизированный доступ Альтернативы “из коробки” - быстрее Типизированный доступ Reflection-like
- 165. “А что если ValueType? Boxing же!”
- 166. ValueType
- 167. ValueType
- 168. ValueType
- 172. Ни рефлексией единой: Value Type
- 173. Ни рефлексией единой: Value Type Reflection: boxing
- 174. Ни рефлексией единой: Value Type Reflection: boxing Альтернатива Reflection-like: boxing
- 175. Ни рефлексией единой: Value Type Reflection: boxing Альтернатива Reflection-like: boxing Типизированный доступ: no boxing
- 176. Приватные данные
- 181. Доступ к данным
- 182. Доступ к данным Reflection
- 183. Доступ к данным Reflection: Медленно
- 184. Доступ к данным Reflection: Медленно Boxing
- 185. Доступ к данным Reflection: Медленно Boxing Альтернативы
- 186. Доступ к данным Reflection: Медленно Boxing Альтернативы: Сильно быстрее Reflection
- 187. Доступ к данным Reflection: Медленно Boxing Альтернативы: Сильно быстрее Reflection Boxing
- 188. Доступ к данным Reflection: Медленно Boxing Альтернативы: Сильно быстрее Reflection Boxing / No Boxing
- 189. Доступ к данным Reflection: Медленно Boxing Альтернативы: Сильно быстрее Reflection Boxing / No Boxing Можно и
- 190. Доступ к данным Reflection: Медленно Boxing Альтернативы: Сильно быстрее Reflection Boxing / No Boxing Можно и
- 192. Сценарий использования
- 193. Сериализация
- 194. Сериализация
- 195. Сериализация
- 196. Сериализация
- 197. Сериализация
- 198. Сериализация
- 199. Но!
- 200. Сгенерированный сериализатор
- 201. Сгенерированный сериализатор
- 202. Сериализация
- 207. ValueType. Reflection-like
- 208. ValueType. Generated
- 215. Ни рефлексией единой BinaryFormatter Newtonsoft.Json System.Text.Json Google.Protobuf AutoMapper
- 216. Ни рефлексией единой BinaryFormatter: Reflection Newtonsoft.Json System.Text.Json Google.Protobuf AutoMapper
- 217. Ни рефлексией единой BinaryFormatter: Reflection ¯\_(ツ)_/¯ Newtonsoft.Json System.Text.Json Google.Protobuf AutoMapper
- 218. Ни рефлексией единой BinaryFormatter: Reflection Newtonsoft.Json: IL Emit System.Text.Json Google.Protobuf AutoMapper
- 219. Ни рефлексией единой BinaryFormatter: Reflection Newtonsoft.Json: IL Emit System.Text.Json: IL Emit Google.Protobuf AutoMapper
- 220. Ни рефлексией единой BinaryFormatter: Reflection Newtonsoft.Json: IL Emit System.Text.Json: IL Emit Google.Protobuf: Property AutoMapper
- 221. Ни рефлексией единой BinaryFormatter: Reflection Newtonsoft.Json: IL Emit System.Text.Json: IL Emit Google.Protobuf: Property (Генерация C# -
- 222. Ни рефлексией единой BinaryFormatter: Reflection Newtonsoft.Json: IL Emit System.Text.Json: IL Emit Google.Protobuf: Property (Генерация C# -
- 223. Осталось за скобками Безопасность Инстанцирование объектов (new, CreateInstance) Парсинг данных Схема и версионирование данных Генерация C#
- 224. Ни рефлексией единой Reflection - медленно Есть достойные альтернативы: CreateDelegate / IL Emit / Expression Trees
- 227. Скачать презентацию