Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP CRM-21256 Improve performance of payment processor load #11060

Closed
wants to merge 2 commits into from

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Oct 3, 2017

Overview

Improve performance of "Submit Credit Card Contribution" page load.

Before

CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting() is being called 4 times (3 for BackOffice, once for futurePayment capability) for a backoffice payment and having quite a noticeable performance impact on the "Submit Credit Card Contribution" form.

After

It's still being called 4 times, but we return the cached (via static var) result on each subsequent call.

Technical Details

  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


@monishdeb
Copy link
Member

@mattwire there are 24 related test failures, can you fix those? Thanks!

@mattwire mattwire force-pushed the CRM-21256_payproc_live_only branch from 2da96cb to 38cd4fb Compare October 16, 2017 18:59
@mattwire mattwire changed the title Crm 21256 payproc live only CRM-21256 Improve performance of payment processor load Oct 16, 2017
@mattwire mattwire changed the title CRM-21256 Improve performance of payment processor load WIP CRM-21256 Improve performance of payment processor load Oct 22, 2017
@mattwire
Copy link
Contributor Author

Jenkins test this please

@eileenmcnaughton
Copy link
Contributor

@mattwire I merged my one & am closing this - but I did leave out a change in yours so you may wish to revisit

@mattwire
Copy link
Contributor Author

@eileenmcnaughton Great :-) Thanks for taking a look at this and getting it resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants