我们的动机(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!

我们的动机(Our motivation)的更多相关文章

  1. 面向对象设计模式纵横谈:Abstract Factory 抽象工厂模式(笔记记录)

         今天是设计模式的第二讲,抽象工厂的设计模式,我们还是延续老办法,一步一步的.演变的来讲,先来看看一个对象创建的问题. 1.如何创建一个对象 常规的对象创建方法: 这样的创建对象没有任何问题, ...

  2. 面向对象设计模式纵横谈:Singelton单件模式(笔记记录)

       李建忠老师讲的<面向对象设计模式纵横谈>,早就看过了,现在有了时间重新整理一下,以前的博客[赛迪网]没有了,现在搬到博客园,重新过一遍,也便于以后浏览. 设计模式从不同的角度分类会得 ...

  3. C#面向对象设计模式纵横谈——6.Prototype 原型模式(创建型模式)

    动机(Motivation) 在软件系统中,经常面临着“某些结构复杂的对象”的创建工作.由于需求的变化,这些对象经常面临着剧烈的变化,但他们却拥有比较稳定一致的接口. 如何应对这种变化?如何向“客户程 ...

  4. C#面向对象设计模式纵横谈——5.Factory Method 工厂方法模式(创建型模式)

    动机 (Motivation) 在软件系统中,经常面临着“某个对象”的创建工作; 由于需求的变化,这个对象经常面临着剧烈的变化,但是它却拥有比较稳定的接口. 如何应对这种变化?如何提供一种“封装机制” ...

  5. C#面向对象设计模式纵横谈——4.Builder 生成器模式(创建型模式)

    动机 (Motivation) 在软件系统中,有时候面临着“一个复杂对象”的创建工作,其通常由各个部分的子对象用一定的算法构成:由于需求的变化,这个复杂对象的各个部分经常面临着剧烈的变化,但是它们组合 ...

  6. C#面向对象设计模式纵横谈——3.Abstract Factory 抽象工厂(创建型模式)

    动机(Motivation) 在软件系统中经常面临着“一系列相互依赖的对象”的创建工作,同时,由于需求变化,往往存在更多系列对象的创建工作.如何应对这种变化?如何绕过常规对象的创建,提供一种“封装机制 ...

  7. C#面向对象设计模式纵横谈——2.Singleton 单件(创建型模式)

    一:模式分类 从目的来看: 创建型(Creational)模式:负责对象创建. 结构型(Structural)模式:处理类与对象间的组合. 行为型(Behavioral)模式:类与对象交互中的职责分配 ...

  8. Topology and Geometry in OpenCascade-Adapters

    Topology and Geometry in OpenCascade-Adapters eryar@163.com 摘要Abstract:本文简要介绍了适配器模式(adapter pattern) ...

  9. 设计模式学习之路——Decorator装饰模式(结构模式)

    子类复子类,子类何其多 假如我们需要为游戏中开发一种坦克,除了各种不同型号的坦克外,我们还希望在不同场合中为其增加以下一种或多种功能:比如红外线夜视功能,比如水陆两栖功能,比如卫星定位功能等等. 动机 ...

  10. Prototype原型(创建型模式)

    依赖关系的倒置:抽象不应该依赖于实现的细节,实现细节应该依赖于抽象. 原型模式的定义 用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象.prototype模式允许一个对象再创建另外一个可 ...

随机推荐

  1. 【Discuz】关闭QQ互联插件提示信息:系统繁忙,请稍后再试

    版本:X3.2.20160601 提示信息 系统繁忙,请稍后再试 解决方案 Step1.删除QQ互联插件目录 网站的根目录\source\plugin\qqconnect Step2.上传原始QQ互联 ...

  2. 【博客美化】04.自定义地址栏logo

    博客园美化相关文章目录: [博客美化]01.推荐和反对炫酷样式 [博客美化]02.公告栏显示个性化时间 [博客美化]03.分享按钮 [博客美化]04.自定义地址栏logo [博客美化]05.添加Git ...

  3. 去除IE6浏览器下获得焦点的元素的虚线框的两个小办法

    [1]onfocus = "this.blur()"//得到焦点时,失去焦点 e.g. <a href="#" onfocus = "this. ...

  4. Java多线程系列--“JUC线程池”01之 线程池架构

    概要 前面分别介绍了"Java多线程基础"."JUC原子类"和"JUC锁".本章介绍JUC的最后一部分的内容——线程池.内容包括:线程池架构 ...

  5. Linux驱动开发——__stringify

    在Linux内核中有一个宏__stringify,在include/linux/stringify.h定义如下: #ifndef __LINUX_STRINGIFY_H #define __LINUX ...

  6. Gephi可视化(二)——Gephi Toolkit叫板Prefuse

    继在园子里写的<Gephi可视化(一)——使用Gephi Toolkit创建Gephi应用>介绍了如何使用Gephi Toolkit工具集进行可视化编程后,本篇对Gephi Toolkit ...

  7. 【知识积累】BufferedImage类实现图片的切分

    一.引言 如何实现图片分割?若有园友用到这个模块,使用Java的BufferedImage类来实现,图片切分也可以作为一个小工具积累起来,以备不时之需. 二.代码清单 package com.lees ...

  8. plsql修改表报错:ORA-25150

    几次通过plsql修改表结构出现这个错误,为人不求甚解真是要不得.我甚至对老大大言不惭的说没有权限,即便是sql语句都不行.结果赤果果地打脸. 最终找到如下原因: 1.操作用户表空间的默认值问题: 这 ...

  9. Visual Studio远程调试监视器(MSVSMON.EXE)的32位版本不能用于调试64位进程或64位转储

    在VS2013中调试Silverlight项目时,提示:无法附加.Visual Studio远程调试监视器(MSVSMON.EXE)的32位版本不能用于调试64位进程或64位转储.请改用64位版本. ...

  10. EF基本操作增、删、查、改、分页,join……等

    一.批量添加数据 static void Main(string[] args) { add(); add2(); Console.ReadKey(); } static void add() { D ...