Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.25
-
Fix Version/s: 4.7.31
-
Component/s: None
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
-
Verified?:No
Description
Whilst investigating the development of another payment processor extension I found thatÂ
CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting() is being called 4Â times for a backoffice payment and having quite a noticeable performance impact on the "Submit Credit Card Contribution" form.
The linked PR makes the following changes:
- Use a static variable in hasPaymentProcessorSupporting() so we only check once per request.
- Don't load test processors when we don't need to in getPaymentProcessors()
Timings from a (slow) site:
Oct 03 17:07:06 [info] exec time old: 1.7639739513397
Oct 03 17:07:07 [info] exec time old: 1.2242529392242
Oct 03 17:07:15 [info] exec time old: 1.2430901527405
Oct 03 17:07:27 [info] exec time old: 1.2307901382446
Oct 03 17:08:27 [info] exec time new: 1.2210669517517
Oct 03 17:08:28 [info] exec time new: 0.72421288490295
Oct 03 17:08:34 [info] exec time new: 7.1525573730469E-6
Oct 03 17:08:44 [info] exec time new: 6.1988830566406E-6
Attachments
Issue Links
- links to