Having experienced the same performance issues with the commerce_discount_date module, I have isolated the issue to the 'Check discount dates' rule condition. This condition is wasteful as it's getting the value of the date field on every run. When a date value is retrieved, it's parsed and a date object is created.

Instead when building the rule we should use data comparison core rules condition. Doing this mean we only need to parse the date once (at rule build) instead of whenever the price is calculated.

I have attached a patch which does this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catchsaid created an issue. See original summary.

joelpittet’s picture

Version: 7.x-1.0-alpha7 » 7.x-1.x-dev
Status: Active » Needs review

Thanks @catchsaid, just changing the version because everything that gets committed will apply against -dev branch. And needs review so people will look at the patch and know that one is on this issue.

OT: Is that like "Catch Said" or "Catch's Aid"?

joelpittet’s picture

Issue tags: +commerce-sprint, +Performance

Adding a couple tags so the #drupal-commerce channel peeps will see this or the performance people.

Status: Needs review » Needs work