Yii 是一个通用的 Web 编程框架,可以用于开发几乎所有的 Web 套用。由于它是轻量级的且具备了成熟的快取解决方案,它特别适用于开发高流量的套用,例如门户,论坛,内容管理系统(CMS),电子商务系统等等。
与同类产品比较
和多数PHP框架类似,Yii 是一个 MVC 的框架。
Yii 以其优异的性能,丰富的功能和清晰的文档胜出其他框架。Yii 从一开始就仔细设计以适合严谨的 Web 套用开发。它既不是一个其他项目的衍生品,也不是一个第三方工作的组合。 它是作者丰富的 Web 套用开发经验和对大多数流行的 Web 编程框架与套用的研究与思考的成果。
性能
Yii是一个高性能的框架,以下的图表展示了与其他流行的PHP框架比较下Yii的高效率。在这个图表中, RPS代表“每秒请求”,描述了此框架每秒执行多少个请求。这个数字越大,此框架的性能越高,我们可以看到,在这个比较中 Yii 胜过其他框架。The performance advantage of Yii is especially significant when the widely used APC extension is enabled.yii性能
Performance alone is not the whole story (otherwise we should all use plain HTML or PHP). With such superior performance, Yii still provides a very rich feature setwhich can greatly improve your development efficiency.
为什幺Yii如此之快
Yii如此快速是因为它广泛地使用lazy loading技术。比如, 直到第一次使用到这个类,才会包含进来;直到对象第一次访问,才会创造这个对象。Other frameworks suffer from the performance hit because they would enable a functionality (e.g. DB connection, user session) no matter it is used or not during a request.
标準设定
下面我们解释怎样设计基準套用并且得到上面的RPS结果.
基準请求
Since our goal is to compare the minimal overhead of each framework, the benchmark application for each framework should be the simplest one. We choose to display a "Hello World" text string by placing an echo statement in the default action of each application. Any additional framework features (e.g. session) are disabled to ensure fairness of the comparison. To obtain a copy of the benchmark applications, please check out the phpmark project.