Phalcon our motivation (our motivation)

Source: Internet
Author: User
Tags autoload apc php framework
There are using 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 comprehensions 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.

There are a lot of PHP frameworks today, but none of them is like Phalcon (you can trust us completely !). Almost all programmers tend to use frameworks. The main reason is that the framework provides us with a lot of easy-to-use and often tested functions. Based on this framework, we can make our code look more neat (do not repeat it ). However, the framework itself needs to introduce a large number of square files, so that thousands of lines of code to be parsed and executed in each request are recorded in the application. The framework of the face object also has some additional overhead to make some complex programs slower. All these operations will slow down the execution of the program and ultimately affect the user experience of the terminal.

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, optimized med optimizations and generated low-level solutions so as to achieve maximum performance from Phalcon.

Why can't we build such a robust framework with many advantages and disadvantages? This is why Phalcon is generated. Over the past few months, we have thoroughly studied PHP behavior, mainly focusing on performance. Through this in-depth study, we removed unnecessary verification, reduced code, and provided performance, the lower-layer solution is implemented, which improves the performance of our framework.


Why? (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

Using the PHP framework has become necessary in professional php development.

The framework provides a structured way to maintain the project, so that we can write less code to make our work more interesting.

We love PHP and we want to use her to create bigger and greater projects.

How does PHP work internally? (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 med every time for every file in the request

PHP is a weak language. PHP checks the operation type and performs the necessary conversions each time a binary operation is performed (such as 2 + "2 ").

PHP is interpreted rather than compiled. The biggest drawback is the performance loss (which is also the disadvantage of all interpreted languages ).

Each time a script is requested, the script must be first interpreted (parsed)

If the bytecode cache (such as APC and opcache) is not enabled, the syntax check is performed in each file used in each request.

How does the traditional PHP framework work? (How do traditional PHP frameworks work ?)?

? Program Files with classes and functions are read on every request made. Disk reading is expensive in terms of performance, especially when the file structure between des 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

Classes and methods in many files in each request are loaded into the memory. It can be seen that disk reading is a bottleneck, especially when the file path is deep.

Many frameworks today use the lazy loading (autoload) technology to improve the framework performance (loading only when needed)

The methods contained in these classes are not required for each request. These functions occupy unnecessary memory.

The cost of continuous loading and parsing is relatively large, which will greatly affect the performance.

The code of the framework is not changed frequently, but the program is still loaded and interpreted every time it is executed.

How does php c extension work? (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

Each time the web server's service process starts, the C extension will be loaded together with the server

Any application can use the classes and methods provided by these extensions.

The code of the extension components will not be interpreted because they are compiled into the code of a specific platform.

How does Phalcon work? (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

Components are loosely coupled. Nothing in Phalcon is mandatory: You can freely use all the functions of the framework, or use only a small part of the functions.

The underlying optimization policy makes our MVC program have lower overhead.

The ORM framework written in C language can provide higher performance for our database interaction.

Phalcon directly accesses the internal structure of PHP, which also improves the program performance.

Why do we need 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.

The requirements and tasks of each program are different. Some programs are designed to execute some tasks and then generate few changes. These applications can be developed in any language or framework.

Using a front-end cache in a program does not matter whether the design is poor or not, and the performance will be very good.


In addition, the content that an application may produce may be different in each request. In this case, PHP will process all requests and then generate results. These programs may be software system APIs, large-traffic forums, blog systems with a large number of users and messages, statistical programs, management panels, ERP systems, and commercial software that processes real-time information.

Applications are as slow as their components. Phalcon provides a fast multi-functional framework that allows developers to build higher-performance applications.

Following the appropriate encoding method, Phalcon can provide higher performance and use less memory.

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!

Phalcon is committed to creating a PHP framework with higher performance. We now have a convenient, fast, and reliable way to create an application, and it is still very high-performance. Enjoy your Phalcon journey.

Phalcon our motivation (our motivation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.