Cphalcon: Phalcon and PHP 7 (perfomance).

Created on 30 Mar 2015  路  2Comments  路  Source: phalcon/cphalcon

Hello.
With release of PHP 7 (now php-ng) all the classic PHP frameworks will work faster by optimizing of PHP.
Tell me please whether this same acceleration of projects written in Phalcon, after switching to PHP 7?
Thank you.
Kind regards.

Most helpful comment

Phalcon is not an accelerator for PHP or projects written in PHP. Phalcon is a framework that implements its functionality using a low-level language that is C, exporting this functionality as classes and methods that can be used from PHP, the opportunities we are pursuing are:

  • Take advantage of native compilation: which means produce a binary executable representation of the code that a processor can directly understand and execute without the overhead of running bytecode in a VM
  • Reduced memory footprint by using optimised specific-purpose C structures and static types
  • C compilers like GCC/CLANG/VCC can perform several optimisations over the code improving performance
  • Opportunities to place variables and data in the stack. These data have typically higher locality of access
  • Branch prediction is easier as it operates directly over the user code and not over the VM implementation
  • Have direct access to internal structures and functions reducing the computation overhead
  • Profile Guided Optimization (PGO) to improve performance based on existing execution profiles

Phalcon relies on several internal design aspects of PHP such as memory management, garbage collection and its internal structures. The improvement of any of these aspects have a positive impact on Phalcon's performance as well in PHP.

All 2 comments

Phalcon is not an accelerator for PHP or projects written in PHP. Phalcon is a framework that implements its functionality using a low-level language that is C, exporting this functionality as classes and methods that can be used from PHP, the opportunities we are pursuing are:

  • Take advantage of native compilation: which means produce a binary executable representation of the code that a processor can directly understand and execute without the overhead of running bytecode in a VM
  • Reduced memory footprint by using optimised specific-purpose C structures and static types
  • C compilers like GCC/CLANG/VCC can perform several optimisations over the code improving performance
  • Opportunities to place variables and data in the stack. These data have typically higher locality of access
  • Branch prediction is easier as it operates directly over the user code and not over the VM implementation
  • Have direct access to internal structures and functions reducing the computation overhead
  • Profile Guided Optimization (PGO) to improve performance based on existing execution profiles

Phalcon relies on several internal design aspects of PHP such as memory management, garbage collection and its internal structures. The improvement of any of these aspects have a positive impact on Phalcon's performance as well in PHP.

@andresgutierrez
I think we need to create FAQ document...

Was this page helpful?
0 / 5 - 0 ratings