没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
我们的动机(Our motivation)¶
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?
This is why Phalcon was born!
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.
为什么?(Why?)¶
The use of frameworks has become mandatory in professional
development with PHP
Frameworks offer a structured philosophy to easily maintain projects
writing less code and making work more fun
We love PHP and we think it can be used to create larger and more
ambitious projects
PHP 内部是如何运作的?(Inner workings of
PHP?)¶
PHP has dynamic and weak variable types. Every time a binary
operation is made (ex. 2 + “2”), PHP checks the operand types to
perform potential conversions
PHP is interpreted and not compiled. The major disadvantage is
performance loss
Every time a script is requested it must be first interpreted
If a bytecode cache (like APC) isn’t used, syntax checking is performed
every time for every file in the request
传统的 PHP 框架如何工作?(How do traditional
PHP frameworks work?)¶
Many files with classes and functions are read on every request made.
Disk reading is expensive in terms of performance, especially when the
file structure includes deep folders
Modern frameworks use lazy loading (autoload) to increase
performance (for load and execute only the code needed)
Some of these classes contain methods that aren’t used in every
request but they’re loaded always consuming memory
Continuous loading or interpreting is expensive and impacts
performance
The framework code does not change very often, and yet an
application needs to load and interpret it every time a request is made
PHP C 扩展如何工作?(How does a PHP C-
extension work?)¶
C extensions are loaded together with PHP one time on the web
server’s daemon start process
Classes and functions provided by the extension are ready to use for
any application
The code isn’t interpreted because is already compiled to a specific
platform and processor
Phalcon 如何工作?(How does Phalcon work?)¶
Components are loosely coupled. With Phalcon, nothing is imposed on
you: you’re free to use the full framework, or just some parts of it as a
glue components.
Low-level optimizations provides the lowest overhead for MVC-based
applications
Interact with databases with maximum performance by using a C-
language ORM for PHP
Phalcon directly accesses internal PHP structures optimizing execution
in that way as well
为什么需要 Phalcon?(Why do I need
Phalcon?)¶
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.
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.
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 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!
框架基准测试(Framework
Benchmarks)¶
In the past, performance was not considered one of the top priorities when
developing web applications. Reasonable hardware was able to compensate
for that. However when Google@decided@to take site speed into account in the
search rankings, performance became one of the top priorities alongside
functionality. This is yet another way in which improving web performance will
have a positive impact on a website.
The benchmarks below, show how efficient Phalcon is when compared with
other traditional PHP frameworks. These benchmarks are updated as stable
versions are released from any of the frameworks mentioned or Phalcon itself.
We encourage programmers to clone the test suite that we are using for our
benchmarks. If you have any additional optimizations or comments
please@write us.@Check out source at Github
怎样的测试环境?(What was the test
environment?)¶
APC@intermediate code cache was enabled for all frameworks. Any Apache
mod-rewrite feature was disabled when possible to avoid potentially additional
overheads.
The testing hardware environment is as follows:
Operating System: Mac OS X Lion 10.7.4
Web Server: Apache httpd 2.2.22
PHP: 5.3.15
CPU: 2.04 Ghz Intel Core i5
Main Memory: 4GB 1333 MHz DDR3
Hard Drive: 500GB SATA Disk
PHP version and info:
APC settings:
剩余63页未读,继续阅读
资源评论
Willmore
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240509_034911_com.tencent.mtt.jpg
- 基于python实现的医学影像体脂分割+源代码+文档说明(课程设计)
- 基于python实现的医学影像(MIR, CT )图像分割源码+文档说明(高分课程设计)
- 基于python+JavaScript实现的医学影像分割+源代码+文档说明+截图演示+数据(高分毕业设计)
- 基于U-net+pytorch实现的医学影像分割python源码+文档说明+数据+界面截图+博客介绍
- 课程设计-基于Pytorch实现MNIST数据集的手写数字识别源码+数据(Gui界面)+文档说明+模型
- 软件开发国家标准.xls
- pytorch-CNN-SBATM-ubuntudemo
- matplotlibdemo
- pytorch-CNN-dht11温湿度传感器笔记
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功