64

Zend Framework 2 was just released and Zend offers support for ZF1 for only 18 months from now. I know they were working for new features in ZF2 and then they were going to do some major speed improvements to it since it was 5 times slower than ZF1.

I would like to know how slower is ZF2 than ZF1 from benchmarks or tests you did and not pure speculation.

The latest benchmark I found is from February 22, 2012 and it concludes that ZF2 is 4 times slower than ZF1.

Link here

tsergium
  • 1,176
  • 1
  • 14
  • 26
  • 5
    The post you are referring is from February 22, 2012. A lot has changed since then. – Al-Punk Sep 07 '12 at 08:30
  • 32
    Ah, an interesting, relevant, programming-related question? Let's close it as "not constructive"! – Adam Sep 10 '12 at 08:21
  • http://stackoverflow.com/questions/13631418/is-zf2-based-on-move/14356085#14356085 – Developer Jan 16 '13 at 10:26
  • 1
    The benchmark from Feb2012 was many **months** before ZF2 was released. Long before they even started optimizing (especially the DI was slow back then, but very fast now). And AB, the tool used in the test, has had some issues with the headers sent from ZF2, generating odd results. And the Skeleton App is too basic to prove any differences in a real working environment. – Matsemann Jun 14 '13 at 08:47
  • 4
    Yet another Google search that lend me to a closed SO question... – user457015 Aug 19 '13 at 01:16
  • 1
    SO, I think you got to review your Q&A format and make sure all the reviewers have a clear understanding of them. It is really annoying to see questions whose answers are really constructive or informative being closed. – koders Dec 31 '13 at 08:19
  • 1
    @ktamlyn Um...if you're talking about Adam's, then you've missed his point entirely. –  Oct 16 '14 at 14:20
  • @Poldie you are right I did miss his point initially. – ktamlyn Oct 16 '14 at 17:33

1 Answers1

98

FAQ - (Answers based on personal experiment done yesterday)

What has changed in Zend Framework 2 from Zend Framework 1?

Architecture

ZF1 is based on MVC , ZF2 is based on MOVE. Huge difference. MOVE = Model Operations Views Events , MVC = Models Views Controllers. More here. Zend Framework 2 uses 100% object-oriented code and utilises most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures. source

Size of installation

The latest ZF1 file is approx 30Mb and ZF2 is approx 2.5Mb (Zipped).

Dependency

ZF1 is core set of libraries and very loosely coupled architecture (with respect to its competitor/player - CakePHP). ZF1 does not require much of 'gems' (as in ruby) but, can do better with plugins. ZF2 requires you to know about composer - phar and soon it may out-match any other framework. New concept : Dependency Injection for Zend fans.

Certification

Certification is available only for ZF1, however, there are rumours about their talks for ZF2 certs though training material is available online.

Conventions

classname in ZF1 was Zend_Db_Table for class in Zend/Db/Table.php whereas in ZF2, it is class My\Auth\Adapter . Enough said.

Community

ZF1 was backed by Zend Technologies (and few other, unnamed). ZF2 has remarkable supporters including Google and Microsoft. Source here

Speed

It took approx 20 times more time to execute "Hello World!" in ZF2. I am not judging here. I could be wrong here. DIY.

Which one should I opt for?

MVC is been around since almost a decade and if you are one of them who are feeling sad for a new architecture altogether then hey! IT is 'your chosen' domain, keep up with the trends and update yourself! Start ZF2 from here.

Keval Domadia
  • 4,768
  • 1
  • 37
  • 64
  • 4
    Thank you for the quick response. I have been working with ZF1 since 2 years ago and I am still waiting for feedback on it's performance before I switch to ZF2. And, 20 times slower for a "Hello World" is at least worrying. – tsergium Sep 07 '12 at 09:43
  • 8
    I have to disagree on one point: You don't need to know anything about composer. It surely helps a lot when installing modules but it's even possible to install dependency-heavy modules like Doctrine ORM without it. – Daniel M Sep 07 '12 at 09:55
  • 1
    @DanielM Thanks for agreeing to my other points. I have been actively working on Zend Framework 1 , CodeIgniter and CakePHP. Recently, Cake has picked up in market (according to me) because of its huge repository (bakery).. ZF2 is trying to implement similar 'concept'. Considering, everyone professionals here, I made this point because, it would be great if a 'plugin' would take care of 'remember me' in login ;) – Keval Domadia Sep 07 '12 at 11:25
  • 20 times slower for a "Hello World" don't sound quite right. It may be true in a dev environment where things like the config files have to be merged every request, but it shouldn't be the case in production. – superdweebie Sep 08 '12 at 03:28
  • 1
    My dev env is Intel I7 with 8GB RAM and fast SSD. ZF2 run on a virtual server 2GB RAM (kvm) and provide request within 30ms. With heavy SQL it takes 40ms. And I still didnt implanted cache and such. – michaelbn Sep 08 '12 at 15:17
  • I didnt say 20 seconds, 20 TIMES is what I noted when I tested it. – Keval Domadia Sep 08 '12 at 15:28
  • 3
    You should remove the "Hello world" test, as it indicate nothing of it is in a real environment. – Matsemann Oct 19 '12 at 07:22
  • 1
    you have the chance to write MVC code using zf2 and i think zf2 is not MOVE based, it has the MOVE feature. MVC fans shouldn't panic, zf2 kept and improved its ancestor decoupled nature so you can use what you need :) – shampoo Mar 09 '13 at 06:38
  • @Matsemann: No he shouldn't. That item is the only part of his response which is related to the question (i.e. performance comparison). – wmac May 15 '14 at 09:45
  • @wmac but it's a horrible way to measure performance. At least have something non-trivial that resembles an actual use case. – Matsemann May 15 '14 at 10:11
  • This answer is outdated, does not answer the question right, and the test results require more details. – user228395 Feb 03 '16 at 14:19