22
Phalcon 3.0 & Zephir Andres Gutierrez Phalcon

Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

  • Upload
    fwdays

  • View
    444

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 3.0 & ZephirAndres GutierrezPhalcon

Page 2: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

About me

● PHP Developer● More than 10.000 hours programming

Page 3: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

A FRAMEWORK FORPHP

DELIVERED AS AN EXTENSION

Page 4: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Some time ago...

Page 5: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 0.1.x/0.2.xA group of nerds trying to make a full stack C framework work for the first time

Year: 2011

Social Networks: 0Look everyone!, it’s a pointer

Let’s try to call a PHP function from C

Page 6: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 0.3.0First public release

Basic functionality working

Released: 2012

Social Networks: 45

Page 7: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 0.5.0Single-module apps, Dependency Injection, PHQL, Micro apps, CLI and more

Only MySQL/PostgreSQL databases were supported

Released: 2012

Social Networks: 400

Page 8: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 0.6.0Volt template engine & MongoDB support

Released: 2013

Social Networks: 700

Page 9: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 1.0.0Full 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

Page 10: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 2.0Core was rewritten in Zephir

Full backwards compatibility with Phalcon 1.x

Released: 2014

Social Networks: 6700

Page 11: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Zephir

Page 12: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

ZephirThe 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

Page 13: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Zephir

Page 14: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Zephir● Create extensions for PHP 5 and PHP 7● Create DLLs for Windows● Create Shared Objects (.so) for Linux/Unix● OSX support

Page 15: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
Page 16: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
Page 17: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

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)

Page 18: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"
Page 19: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Real performance best practices● Cache everything apc, redis, memcached

Page 20: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Real performance best practices● Scale your sessions up

Page 21: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Phalcon 3.0.0PHP7 support

Removed old APIs

LTS extended support

Released: 2016

Social Networks: 12,800

Page 22: Andres Gutierrez "Phalcon 3.0, Zephir & PHP7"

Gracias/Thanks!Questions?