Zend Date – Huge Performance issue

While working on a project that make use of the Zend Framework as backend for an AIR Application, I stumbled upon an amazing discovery. By the past, I knew that using Zend_Date can be somewhat slow, but I didn’t pay more attention to it.

The backend application is collection of DAOs that defines some services. Many of those service make just a request to the database to fetch data, and try to populate (hydrate) some value objects  (or  DTOs). When benchmarking the application, I noticed that the big amount of time is spent in this hydratation process, which is no more than of bench of affectations, with the exception of database datetime fields which are converted  to  Zend_Date objects.

By making use of the native PHP DateTime object, that Zend_AMF accept as date type that will be correctly serialized to Actionsctipt Date, the performance got better, take a look at this small comparaison :


À propos de cette entrée