当前位置: 首页 > news >正文

河南网站网络营销推广WordPress显示不出广告

河南网站网络营销推广,WordPress显示不出广告,安 网站建设,数据库连接wordpress在从零实现AOP的过程中#xff0c;难免会需要大量反射相关的操作#xff0c;虽然在.net 4.5/.net core中反射的性能有了大幅的优化#xff0c;但为了追求极致性能#xff0c;自己实现了部分反射的替代方案#xff0c;包括构造器调用、方法调用、字段读写#xff0c;属性读… 在从零实现AOP的过程中难免会需要大量反射相关的操作虽然在.net 4.5/.net core中反射的性能有了大幅的优化但为了追求极致性能自己实现了部分反射的替代方案包括构造器调用、方法调用、字段读写属性读写和特性读取。在重构时把反射扩展操作封装到单独的项目AspectCore.Extension.Reflection中以此方便自己和大家使用。 获取AspectCore.Extension.Reflection 通过nuget获取AspectCore.Extension.Reflection    Install-Package AspectCore.Extensions.Reflection -pre 构造器反射扩展 提供ConstructorReflector作为构造器反射扩展的入口使用方式类似System.Reflection.ConstructorInfo var constructorInfo typeof(ConstructorFakes).GetTypeInfo().GetConstructor(new Type[0]);var reflector constructorInfo.GetReflector();var instance reflector.Invoke(args); 性能测试Reflection为.NET Core提供的反射调用Reflector为AspectCore.Extension.Reflection调用Native为硬编码调用下同 |     Method |       Mean |     Error |    StdDev |    StdErr |          Op/s |  Gen 0 | Allocated ||----------- |-----------:|----------:|----------:|----------:|--------------:|-------:|----------:|| Reflection | 119.505 ns | 0.5146 ns | 0.4814 ns | 0.1243 ns |   8,367,831.8 | 0.0074 |      24 B ||  Reflector |   8.990 ns | 0.0403 ns | 0.0377 ns | 0.0097 ns | 111,236,649.9 | 0.0076 |      24 B ||     Native |   3.825 ns | 0.0620 ns | 0.0580 ns | 0.0150 ns | 261,404,148.5 | 0.0076 |      24 B | 方法调用反射扩展 提供MethodReflector作为方法反射扩展的入口使用方式类似System.Reflection.MethodInfo var typeInfo typeof(MethodFakes).GetTypeInfo();var method typeInfo.GetMethod(Call);var refector method.GetReflector(); refector.Invoke(instance,args); 性能测试 |             Method |        Mean |     Error |    StdDev |    StdErr |            Op/s ||------------------- |------------:|----------:|----------:|----------:|----------------:||        Native_Call |   1.0473 ns | 0.0064 ns | 0.0050 ns | 0.0015 ns |   954,874,046.8 ||    Reflection_Call |  91.9543 ns | 0.3540 ns | 0.3311 ns | 0.0855 ns |    10,874,961.4 ||     Reflector_Call |   7.1544 ns | 0.0628 ns | 0.0587 ns | 0.0152 ns |   139,774,408.3 | 属性调用反射扩展 提供PropertyReflector作为属性反射扩展的入口使用方式类似System.Reflection.PropertyInfo var property   typeof(PropertyFakes).GetTypeInfo().GetProperty(Property);var reflector property.GetReflector();var value reflector.GetValue(instance); 性能测试 |                    Method |       Mean |     Error |    StdDev |    StdErr |          Op/s |  Gen 0 | Allocated ||-------------------------- |-----------:|----------:|----------:|----------:|--------------:|-------:|----------:||       Native_Get_Property |   1.178 ns | 0.0244 ns | 0.0229 ns | 0.0059 ns | 848,858,716.1 |      - |       0 B ||   Reflection_Get_Property | 103.028 ns | 0.2217 ns | 0.2074 ns | 0.0535 ns |   9,706,088.1 |      - |       0 B ||    Reflector_Get_Property |   4.172 ns | 0.0194 ns | 0.0172 ns | 0.0046 ns | 239,694,827.7 |      - |       0 B ||       Native_Set_Property |   2.002 ns | 0.0122 ns | 0.0114 ns | 0.0030 ns | 499,447,543.5 |      - |       0 B ||   Reflection_Set_Property | 188.313 ns | 0.5347 ns | 0.5002 ns | 0.1292 ns |   5,310,298.0 | 0.0203 |      64 B ||    Reflector_Set_Property |   5.878 ns | 0.0234 ns | 0.0219 ns | 0.0056 ns | 170,138,324.7 |      - |       0 B | 特性获取扩展 以获取方法上标记的特性为例。 方法定义如下 [Attribute1][Attribute2(benchmark, Id 10000)][Attribute3][Attribute3][Attribute3]public void Method(){} 使用MethodReflector来获取特性 var method type.GetMethod(Method);var reflector method.GetReflector();var attribute1 reflector.GetCustomAttribute(typeof(Attribute1));var attributes reflector.GetCustomAttributes(); 性能测试 |                                      Method |        Mean |         Op/s |  Gen 0 | Allocated ||-------------------------------------------- |------------:|-------------:|-------:|----------:||               Reflection_GetCustomAttribute | 4,642.13 ns |    215,418.5 | 0.2289 |     744 B ||                Reflector_GetCustomAttribute |    35.52 ns | 28,154,302.3 | 0.0101 |      32 B || Reflection_GetCustomAttributes_WithAttrType | 5,354.49 ns |    186,759.2 | 0.3281 |    1048 B ||  Reflector_GetCustomAttributes_WithAttrType |   168.61 ns |  5,930,816.1 | 0.0710 |     224 B ||          Reflection_GetCustomAttributes_All | 7,915.45 ns |    126,335.2 | 0.5035 |    1632 B ||           Reflector_GetCustomAttributes_All |    98.36 ns | 10,166,253.6 | 0.0737 |     232 B ||                        Reflection_IsDefined | 1,723.30 ns |    580,283.6 | 0.0801 |     256 B ||                         Reflector_IsDefined |    35.55 ns | 28,126,759.1 |      - |       0 B | 可以看到AspectCore.Extension.Reflection在性能上都比反射有2个数量级的优化达到了和硬编码调用相同的数量级。尤其是获取特性的优化最为明显。 可以在Github获取详细的性能测试。 Github : https://github.com/dotnetcore/AspectCore-Framework 原文地址http://www.cnblogs.com/liuhaoyang/p/aspectcore_extension_reflection.html .NET社区新闻深度好文微信中搜索dotNET跨平台或扫描二维码关注
http://www.huolong8.cn/news/346155/

相关文章:

  • 全国做临期进口食品的网站wordpress媒体库在哪
  • 建设教育网站费用wordpress用户注册文件
  • 有口碑的南昌网站建设河南省建设工程监理协会网站
  • 数学教学网站开发jsp网站开发详解书
  • 百度搜索网页东莞seoseo关键词排名优化
  • 共同建设网站心得怎么生成链接
  • 保定建站公司模板凡科免费建站
  • 如何远程连接 网站 数据库上海早晨新闻今天
  • 漳州市住房城乡建设局网站wordpress 付费支持
  • 网站网页设计专业公司网站建设服务费计入会计科目
  • 展开网站建设网站seo分析
  • 专业海外网站推广揭阳网站建设解决方案
  • 黄一级a做爰片免费网站深圳福田区住建局官网
  • 网站转化怎么做嵌入式开发是干啥的
  • 淘宝网站制作多少钱.wordpress淘宝客模版
  • 有专门教做蛋糕的网站网站的空间什么意思
  • 网站页面设计图片素材糕点烘焙专业培训学校
  • 做网站注册哪些商标做绿化生意有什么网站
  • 智慧旅游景区网站建设看楼盘的app
  • 天津品牌网站建设哪个好免费设计装修公司
  • 营销型网站建设的流程e盒印网站开发
  • 深圳企业黄页网站网站域名查询工具
  • 手机网站模板使用方法威海网站优化推广
  • 石龙网站设计卖鞋的网站建设思路
  • 做网站 框架h5页面制作免费平台
  • 盗用别人的图片做网站犯法2017做啥网站能致富
  • 贵阳网站外包如何制作小程序视频教学
  • 滨州北京网站建设价格低安徽淮北发现一例
  • 做编程网站有哪些幻灯网站源码
  • 有下划线的网址是什么网站广西网站建设原创