PHP7 & Symfony 2 @ Symfony Barcelona May meetup

PHP7 & Symfony 2 @ Symfony Barcelona May meetup

Talk about PHP7 and Symfony 2 at the Symfony Barcelona May meetup with quite a lot more benchmarks than in my previous PHP7 talk. On top of that, PHP7 is now feature complete so this is what we are going to get!

8f2089782f2711659072020ad7227aff?s=128

Albert Casademont

May 22, 2015
Tweet

Transcript

  1. 3.
  2. 4.
  3. 5.
  4. 7.
  5. 9.
  6. 13.

    Internals heavily modified data structs (current extensions won't work) call

    frame optimization new memory manager we finally have an AST! no JIT (yet)
  7. 14.

    Internals Immutable arrays PCRE with JIT new JSON parser ...and

    lots more (watch Dmitry Stogof's talk on PHP7 internals for more!)
  8. 16.
  9. 18.
  10. 20.
  11. 22.
  12. 24.
  13. 25.
  14. 27.

    x10

  15. 28.
  16. 29.

    Scalar type hinting Most wanted feature EVER! 2 flavors: weak

    & strict declare(strict_types=1); weak => casting strict => error
  17. 31.

    Userland BC breaks New reserved keywords int, float, bool, string,

    true, false, null Symfony Validator BC Break!! True => IsTrue False => IsFalse Null => IsNull Available in SF >= 2.6.8, 2.3.29 LTS
  18. 32.
  19. 33.

    Test environment VM Debian 8 1GB RAM, 1 core, SSD

    ulabox.com sf2 index / product page (prod) sf2 demo bundle (dev), composer update PHP 5.5 / 5.6 / 7.0 opcache.validate_timestamps = 0 opcache.enable_file_override = 1 HHVM 3.7 hhvm.server_stat_cache = 1 No extensions! (APCu) Nginx, Redis, Solr, MySQL
  20. 34.

    PHP 5.3 PHP 5.4 PHP 5.5 PHP 5.6 PHP 7.0

    HHVM 3.7 0 0.5 1 1.5 2 2.5 2.22 1.83 1.78 1.75 0.83 0.3 Time (seconds) Bench.php
  21. 35.

    PHP 5.3 PHP 5.4 PHP 5.5 PHP 5.6 PHP 7.0

    HHVM 3.7 0 2 4 6 8 10 12 14 13.25 12.75 12.5 12.5 8.25 7.8 Memory consumption (MB) Bench.php
  22. 36.

    PHP 5.3 PHP 5.4 PHP 5.5 PHP 5.6 PHP 7.0

    HHVM 3.7 0 5 10 15 20 25 30 35 29.97 29.91 29.17 12.47 17.86 Time (seconds) composer update --profile
  23. 37.

    PHP 5.3 PHP 5.4 PHP 5.5 PHP 5.6 PHP 7.0

    HHVM 3.7 0 100 200 300 400 500 600 700 800 900 812 812 812 551 316 Memory consumption (MB) composer update --profile
  24. 38.

    PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.7 0 5

    10 15 20 25 30 26 24 13 19 Time (milliseconds) SF2 - AcmeDemo
  25. 39.

    PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.7 0 2

    4 6 8 10 12 10.75 10.75 4.75 0.48 Memory consumption (MB) SF2 - AcmeDemo
  26. 40.

    PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.7 0 10

    20 30 40 50 60 70 80 90 81 76 44 56 Time (milliseconds) SF2 – ulabox index
  27. 41.

    PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.7 0 2

    4 6 8 10 12 14 16 18 20 17.25 17.25 12 4.19 Memory consumption (MB) SF2 – ulabox index
  28. 42.

    PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.7 0 20

    40 60 80 100 120 109 103 60 72 Time (milliseconds) SF2 – ulabox product
  29. 43.

    PHP 5.5 PHP 5.6 PHP 7.0 HHVM 3.7 0 5

    10 15 20 25 20.75 20.5 14 5 Memory consumption (MB) SF2 – ulabox product