(15)Reduce memory leaks dramatically with the “using” statement 招数15: 显式的使用using语句减少内存泄露 If a type implements IDisposable, wrap the use of it in a “using” statement, so that it automatically disposes of objects properly when the block exits.如果一个类实现了I…
(30)Static collections 招数30: 静态集合 If a collection is static, make sure it only contains the objects you need. If the collection is iterated over often, then the performance can be slow if you don’t remove unnecessary objects. Objects in a collection…
Database Performance Tips for Developers对于开发人员的数据库性能技巧 As a developer you may or may not need to go into the database and write queries or design tables and indexes, or help determine configuration of your SQL Server systems. But if you do, these tip…
(27)Throw hardware at the problem, not developers 招数27: 把问题仍给硬件而不是开发人员 As developers, we often want to fix problems with code, but don’t be afraid to ‘put the compiler down’ and throw some hardware at the problem.作为开发人员,我们通常想通过代码解决问题,但不要害怕‘批评编译器’和把问题…
(17)Avoid running sites in debug mode 招数17: 避免在调试模式下运行网站 When it comes to ASP.NET, one of the most common performance blunders I see on a regular basis is accidentally or intentionally running sites in debug mode. Language-level optimizations, such a…
(13)Always perform validation on the server as well 招数13: 总是在服务器端执行验证 This isn’t exactly a performance tip but rather a security tip for when people think that they could improve performance by cutting out server-side validation. These days, client-s…
(2)Remove unused View Engines 招数2: 移除不用的视图引擎 If you're an ASP.NET MVC developer, you might not know that ASP.NET still loads the View Engines for both Razor and Web Forms by default. This can cause performance issues because MVC will normally look fo…
ORM TipsORM小窍门 More and more people are using Object to Relational Mapping (ORM) tools to jump the divide between application code that is object oriented and a database that is storing information in a relational manner. These tools are excellent an…
(39)Avoid using session state 招数39: 避免使用会话状态 Where possible, you should try and avoid using session state. Whilst using one web server, performance is usually not a problem. This changes as soon as you need to scale to multiple servers, as different,…
(32)Seven handy ViewState tips 招数32: 7条便利的ViewState技巧 Every time I have to deal with a classic ASP.NET Web Forms application, one of the first things I look at is the resulting source, to check whether the DOM is a complete mess and whether the ViewS…
(29)Before tackling any website performance issue, first verify the problem isn’t on the client 招数29: 在处理网站性能问题前,首先验证问题是否出在客户端 Traditionally, many performance problems have been rooted in either the database or application server. 习惯上,许多性能问题要么根植于数据库或…
(28)Don’t assume that problems can only arise from business logic 招数28: 不要认为问题只会从业务层产生 When beginning to diagnose performance problems, we often assume the problem is in our business logic. Don’t forget that the areas of our code that provide infrast…
(26)Don’t underestimate the value of the UI when tackling performance problems 招数26: 解决性能问题时不要低估UI的价值 Simple UI tricks, such as progress bars, redirecting users’ attention using animation, or placing slower loading sections at the bottom of a page or…
(25)Use the startMode attribute to reduce the load time for your ASP.NET site 招数25: 使用startMode属性来减少ASP.NET站点加载时间 Every time you update your site, IIS must recompile it during the first request, so the initial request takes significantly longer than…
(16)Reduce the data sent across the network 招数16: 减少通过网络发送的数据 Reducing the amount of data sent across the network can improve application performance significantly. Compressing CSS and JavaScript is possible using bundling and minification. This will…
(14)Review what client scripts you are using 招数14: 检查你使用了什么客户端脚本 Out of the box, many ASP.NET projects include client script libraries which you may or may not beusing. It’s always a good idea to check what you are using, and when.拿来即用,很多ASP.NET项目包括你…
(11)Make sure paging is conducted at the database layer 招数11: 确保分页是在数据层完成的 When using grid UI controls (framework based, or 3rd party owned), you should carefully consider how paging is implemented. Many controls implement paging in a simplistic fash…
(4)A selection of tips 招数4: 精选的技巧 Make sure HTTP compression is turned on for any uncompressed content. HTML in particular compresses significantly, and in this era of mobile friendliness and slow 3G connections, that’s essential.确保为未压缩的内容打开HTTP压缩.在这…
(1)Caching is a last resort 招数1: 缓存是最后的手段 Projects that use multiple levels of cache often demonstrate a misunderstanding of why caching is required in the first place. 项目中使用多重缓存经常会表现会产生误会,为什么缓存是第一步必须的. Caching is not synonymous with performance. You…
(41)StringBuilder is NOT the answer for all string concatenation scenarios; String.Join could be 招数41: StringBuilder不适用于所有字符串连接的场景:String.Join可能是 Yes, if you are in a loop and adding to a string, then a StringBuilder *could* be most appropriate. Howe…
(40)Take advantage of .NET 4.5 async constructs 招数40: 利用.NET 4.5异步结构 With the arrival of .NET 4.5, writing async code correctly is easier than ever. Like any tool, it should be only applied where it makes most sense – in web use-cases this usually re…
(31)Know your loops 招数31: 认识你的循环 for is the fastest way of iterating over a collection, foreach is a little slower, and LINQ queries are slowest.for是遍历集合最快的方法,foreach略慢一些,LINQ查询最慢. 测试代码: using System; using System.Collections.Generic; using System.Li…
(19)A selection of tips 招数19: 精选技巧集合 Including height and width in <img /> tags will allow your page to render more quickly, because space can be allocated for the image before it is downloaded.在<img />标签中包括height和width属性会加速你的页面呈现,因为下载完成之前空间可以…
(18)When in production, carefully consider what you need to log 招数18: 在生产环境,仔细考虑你需要记录哪些日志 Many people deploy to production without checking how logging is currently configured. It is always advisable to check whether your policy is to have logging on…
(12)For a snappy user experience, always validate on the client 招数12: 为了生动的用户体验,总是在客户端验证 To avoid unnecessary round trips to the server, validate form entries on the client using JavaScript before posting them. This provides quick feedback and makes…
(3)Use Microsoft’s PDBs to debug or profile external assemblies or libraries 招数3: 使用Microsoft的PDBs调试和分析外部的程序集和库 To accurately debug or profile an external assembly or library (i.e. one you’re not directly compiling), you need the PDB files that accom…
1.简介 有些测试场景或者事件,Selenium根本就没有直接提供方法去操作,而且也不可能把各种测试场景都全面覆盖提供方法去操作.比如:就像鼠标悬停,一般测试场景鼠标悬停分两种常见,一种是鼠标悬停在某一个元素上方,然后会出现下拉子菜单,第二种就是在搜索输入过程,选择自动补全的字段.关于鼠标悬停,selenium把这个方法放在了Actions.java文件中,先来看看鼠标悬停出现下拉菜单的情况. 2.鼠标悬停出现下拉菜单 鼠标悬停出现下拉菜单,顾名思义就是:鼠标悬停在某一元素上出现下拉菜单. 2.…
1.简介 在做web自动化时,有些情况selenium的api无法完成,需要通过第三方手段比如js来完成实现,比如去改变某些元素对象的属性或者进行一些特殊的操作,本文将来讲解怎样来调用JavaScript完成特殊操作. 2.用法 创建一个执行 JS 的对象,也就是 JavascriptExecutor 对象,这个对象是由 driver 进行强制类型转换而来,即JavascriptExecutor js= (JavascriptExecutor)driver:然后这个对象 js 就可以调用 exe…
1.简介 今天本来是要介绍远程测试的相关内容的,但是宏哥在操作服务器的时候干了件糊涂的事,事情经过是这样的:本来申请好的Windows服务器用来做演示的,可是服务器可能是局域网的,连百度都不能访问,宏哥想调试一下网络,禁用网卡,然后重启网卡,结果禁用后就连不上了....就只能等服务器分配的管理员在物理机操作了,他给我分配的估计是虚拟机的服务器.唉,不能演示了,那么宏哥就来介绍java+ selenium自动化测试截图操作的实现,大致分为三篇,每篇介绍一种截图方法,你喜欢那种就用那种.那么宏哥今天…
1.简介 在实际测试中,我们不仅需要读取Excle,而且有时候还需要读取CSV类的文件.如何去读取CSV的文件,宏哥今天就讲解和分享一下,希望对你能够有所帮助.前面介绍了如何读取excel文件,本篇介绍如何读取vsc文件,同样需要用到第三方lib去处理读取csv文件的数据. 2.什么是CSV? csv是[comma-separated values]的缩写,代表一种包含数据列表的纯文本文件格式,这些csv文件通常用于在不同应用程序之间交换数据.因分隔符没有严格的要求,可以使用逗号,也可以使用其他…