內容目录上一个主题下一个主题本页 |
框架的动机(Our motivation)¶现在市面上有不计其数的框架,但是没有一个能和Phalcon相提并论的(真的,请相信Phalcon)。 There are many PHP frameworks nowadays, but none of them is like Phalcon (Really, trust us on this one). 几乎所有的程序员都喜欢用框架,因为框架为我们提供了很多经过测试的便捷的函数方法,让我们不用再去重复造轮子。但是在每次请求的时候框架要去加载和解析成千上万行的代码和文件,越是面向对象封装越完善的框架加载越慢,正是因为这样应用会变的越来越慢从而影响了最终的用户体验。 Almost all programmers prefer to use a framework. This is primarily because it provides a lot of functionality that is already tested and ready to use, therefore keeping code DRY (Don’t Repeat Yourself). However, the framework itself demands a lot of file inclusions and hundreds of lines of code to be interpreted and executed on each request from the actual application. Object-Oriented frameworks also add a lot of overhead to execution making complex application slow. All these operations slows the application down and subsequently impacts the end user experience. 问题(The Question)¶为什么我们不能拥有一个非常稳定健壮并包含全部的优点的完美无缺的框架呢?即使有缺点也就那么一点点也可以啊! Why can’t we have a robust framework with all of its advantages but with none or very few disadvantages? 这就是为什么Phalcon被创造出来了! This is why Phalcon was born! 在这之前Phalcon团队仔细的研究了php的执行流程和内部机制,考虑了大大小小所有可以优化的地方,将底层的方案进行了多次的改进迭代从而达到让Phalcon的性能最大化。 During the last few months, we have extensively researched PHP’s behavior, investigating areas for significant optimizations (big or small). Through this understanding, we managed to remove unnecessary validations, compacted code, performed optimizations and generated low-level solutions so as to achieve maximum performance from Phalcon. 为什么开发Phalcon?(Why?)¶
PHP 内部是如何运作的?(Inner workings of PHP?)¶
传统的 PHP 框架如何工作?(How do traditional PHP frameworks work?)¶
PHP C扩展如何工作?(How does a PHP C-extension work?)¶
Phalcon 如何工作?(How does Phalcon work?)¶
为什么需要 Phalcon?(Why do I need Phalcon?)¶每个web应用的需求和目的各不相同。一些应用只是用于接受用户请求展示内容,并且很少有更新,这样的应用可以用任意的语言或者是框架来实现,只要使用了前端缓存技术,即使再差的架构设计,使用依然很流畅。 Each application requirements and tasks are different than another’s. Some for instance are designed to do a set of tasks and generate content that rarely changes. These applications can be created with any programming language or framework. Using a front-end cache usually makes such an application, no matter how poorly designed or slow it might be, perform very fast. 一些应用每次请求返回的数据都不相同,PHP需要去接受请求重新生成内容,类似的应用比如API接口,大量用户的论坛,有大量评论和贡献的博客,统计应用,管理员控制面板,ERP系统,处理实时数据商业智能分析系统等等。 Other applications generate content almost immediately that changes from request to request. In this case, PHP is used to address all requests and generate the content. These applications can be APIs, discussion forums with high traffic loads, blogs with a high number of comments and contributors, statistic applications, admin dashboards, enterprise resource planners (ERP), business-intelligence software dealing with real time data and more. 应用的性能由最慢的那个流程环节决定(木桶原理),Phalcon提供了一个非常快速并且完善的框架,让应用运行速度更快。通过合理的代码编写,Phalcon可以让我们使用更少的内存和资源达到最大的性能。 An application will be as slow as its slowest component/process. Phalcon offers a very fast yet feature rich framework that allows developers to concentrate on making their applications/code faster. Following proper coding processes, Phalcon can deliver a lot more functionality/requests with less memory consumption and processing cycles. 结束语(Conclusion)¶Phalcon旨在打造最快的PHP框架。我们现在有了最快最简单的方式去实践“性能真的很重要”这条真理了!开始享受吧! Phalcon is an effort to build the fastest framework for PHP. You now have an even easier and robust way to develop applications with a framework implemented with the philosophy “Performance Really Matters”! Enjoy! |