All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
利用OleDb对象,将数据库中全部表转换成XML文件_[Asp.Net教程]
使用C#来开发.NET,CF,蓝牙通信模块_.net资料_编程技术
ASP.NET与数据库相关技巧_[Asp.Net教程]
asp.net2.0内置Request对象的属性
SQL子查询实例介绍_[SQL Server教程]
用C#程序监控并显示CPU状态信息_.net资料_编程技术
ASP.NET中url传递中文的解决方案_[Asp.Net教程]
网页中防止表格被撑破的方法总结_[Html教程]
asp.net2.0网站语法之ASP.NET 2.0服务器语法
SQL循序渐进(4)-------创建表_[SQL,Server教程]
Reading number is top 10 pictures
如果我是导演...
A man's favorite things10
The Soviet union swimsuit exposure in the 70 year3
The wise woman of chest2
The money of more than 100 countries and regions15
鸡蛋的新玩法
鸡也看毛片
The money of more than 100 countries and regions7
美女浴室写真1
The real super beauty2
Download software ranking
Tram sex maniac 2 (H) rar bag2
SP4 for SQL2000
Twenty piece of palm leaf
Boxer's Top ten classic battle10
仙剑奇侠传98版歌曲
Tram sex maniac 2 (H) rar bag15
Boxer's Top ten classic battle5
Unix video tutorial12
电脑知识及技巧大合集
传奇私服架设教程
aaa published in(发表于) 2013/12/24 5:50:34 Edit(编辑)
PHP技巧:优化动态网页技术PHP程序的12条技巧_php资料_编程技术

PHP技巧:优化动态网页技术PHP程序的12条技巧_php资料_编程技术

PHP技巧:优化动态网页技术PHP程序的12条技巧_php资料_编程技术-你的首页-uuhomepage.com
1、If a method can be static, declare it static. Speed improvement is by a factor of 4.
1、如果一个函数可以声明为静态的,那么就用静态的,速度是改进的一个因素4.

2、# Avoid magic like __get, __set, __autoload
2、避免使用__get, __set, __autoload等魔术函数

3、require_once() is expensive
3、require_once()是相当昂贵的。

4、Use full paths in includes and requires, less time spent on resolving the OS paths.
4、用include和require时,尽量用全路径,可以减少花在解决OS路径的时间

5、If you need to find out the time when the scrīpt started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()
5、如果你需要知道一个脚本的开始运行时间,用 $_SERVER[’REQUEST_TIME’]比用time()要好


6、See if you can use strncasecmp, strpbrk and stripos instead of regex
6、如果可以用strncasecmp, strpbrk and stripos就别用正则

7、preg_replace is faster than str_replace, but strtr is faster than preg_replace by a factor of 4
7、preg_replace比str_replace要快,但是strtr比preg_replace更快

8、If the function, such as string replacement function, accepts both arrays and single characters
as arguments, and if your argument
list is not too long, consider writing a few redundant replacement statements, passing one
character at a time, instead of one line of code that accepts arrays as search and replace
arguments.
一些函数,比如字符串替换函数,接受数组和单个字符做为参数,并且如果你的参数列表不是很长,考虑写一些冗余替换语句,每次传送一个字符,代替一行代码接受数组做为查找和替换的参数。

9、Error suppression with @ is very slow.
9、禁止错误输出符号@是非常慢的。

10、$row[’id’] is 7 times faster than $row[id]
10、、$row[’id’]比 $row[id]快7倍

11、Error messages are expensive
11、错误信息是非常昂贵的

12、Do not use functions inside of for loop, such as for ($x=0; $x < count($array); $x) The count() function gets called each time.
12、不要在循环内部使用函数,比如: for ($x=0; $x < count($array); $x)。count()函数在每次循环中都会被调用。

对于模板,你是否在用smarty?这可能是保证把最经常访问的页面缓存起来的最快的方法了。





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.