Mental Note: Zend_Date compare method is slow?

July 13, 2010 by Reboot · Leave a Comment 

Can someone explain why the standard Zend_Date comparison slowed the performance of an application of mine by a significant amount.
It was checking a date to be within a specific timespan for like 90 times.

$date = new Zend_Date();
if ($date->compare($otherDate) >= 0) {
...

// Now fetching the timestamps to compare those against each other.
// For example:
if ($date->getTimestamp() >= $otherdate.getTimestamp()) {
...
}