Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

1,421 views

Published on

Phalcon is a web framework written as an extension PHP seeking to improve the performance, taking advantage of low-level resources that no other traditional framework can take. Phalcon is a full stack framework, also providing a Micro approach, a template engine called Volt, the first ODM and ORM for PHP written in Zephir/C and many other components that ease the life of developers when creating web applications.
Initial versions of Phalcon were created using C directly as main language. Given the framework success many developers were willing to help, however it required C knowledge and PHP internals expertise, this made it difficult for them the possibility of help.
Since Phalcon 2, we started using Zephir, a brand new, high-level and compiled language created by the core team, that made our collaborators can help out easier to our project making it robust and stable.
Best of all, Zephir allows the easy creation of extensions for both PHP5 and PHP7. An extension can sometimes improve performance, reduce overall memory and processor usage and protect intelectual property.
The talk will be about the project evolution, Phalcon 3 as framework and the advantages of using Zephir for building extensions, also success cases and best practices in terms of performance.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

  1. 1. Phalcon 3.0 & Zephir Andres Gutierrez Phalcon
  2. 2. About me ● PHP Developer ● More than 10.000 hours programming
  3. 3. A FRAMEWORK FOR PHPDELIVERED AS AN EXTENSION
  4. 4. Some time ago...
  5. 5. Phalcon 0.1.x/0.2.x A group of nerds trying to make a full stack C framework work for the first time Year: 2011 Social Networks: 0 Look everyone!, it’s a pointer Let’s try to call a PHP function from C
  6. 6. Phalcon 0.3.0 First public release Basic functionality working Released: 2012 Social Networks: 45
  7. 7. Phalcon 0.5.0 Single-module apps, Dependency Injection, PHQL, Micro apps, CLI and more Only MySQL/PostgreSQL databases were supported Released: 2012 Social Networks: 400
  8. 8. Phalcon 0.6.0 Volt template engine & MongoDB support Released: 2013 Social Networks: 700
  9. 9. Phalcon 1.0.0 Full MVC Applications (Single-Module, Multi-Module and Micro Applications) ORM (Transactions, Behaviors, Relations, PHQL, Events, Validations, Hydration, Logging, Profiling, Sharding) Annotations, escaping, encryption and more Released: 2013 Social Networks: 2100
  10. 10. Phalcon 2.0 Core was rewritten in Zephir Full backwards compatibility with Phalcon 1.x Released: 2014 Social Networks: 6700
  11. 11. Zephir
  12. 12. Zephir The main goals of Zephir are: ● Static/Dynamic typing ● Automatic memory management ● Strict and explicit behavior over flexible and implicit behavior ● Produce object-oriented libraries that can be used in PHP ● Hide unnecessary complexity to developers ● Make the code more debuggable ● Produce exceptions in runtime instead of notices/warnings when possible ● Detect potentially slow or unreachable code and notify the developer about it ● Provide a very low learning curve without creating a new PHP/C implementation
  13. 13. Zephir
  14. 14. Zephir ● Create extensions for PHP 5 and PHP 7 ● Create DLLs for Windows ● Create Shared Objects (.so) for Linux/Unix ● OSX support
  15. 15. NGINX: 9,000 req/s (serving a plain html file) NGINX + PHP7: 5,000 req/s (serving a hello world) NGINX + PHP7 + Phalcon: 2,500 req/s (serving a hello world from a controller) NGINX + PHP7 + Phalcon + MySQL: 800 req/s (serving some data from the database)
  16. 16. Real performance best practices ● Cache everything apc, redis, memcached
  17. 17. Real performance best practices ● Scale your sessions up
  18. 18. Phalcon 3.0.0 PHP7 support Removed old APIs LTS extended support Released: 2016 Social Networks: 12,800
  19. 19. Gracias/Thanks! Questions?

×