Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21256

Payment processor contribution page performance improvement

    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:

      1. Use a static variable in hasPaymentProcessorSupporting() so we only check once per request.
      2. 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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mattwire Matthew Wire
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: