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

API performance: _civicrm_api3_separate_values

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.6
    • Fix Version/s: 4.7
    • Component/s: None
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      This is an issue up for discussion. I've been trying to look at ways of improving the performance of the API.

      My test case was running 25 Contact 'get' calls, for a single ID, using the PHP API.

      Xdebug reports that there is one particularly expensive recursive function that is called during API get requests:

      _civicrm_api3_separate_values
      In: api/v3/utils.php
      This function looks in the result and explodes any values that use the 'separator' character into an array.

      Are there any ways we could optimise this particular function, or the approach of having to call it on the entire result?

      I need to do some more looking in to it, but I'm not sure why it would be called 3900 times for just 25 API calls returning one contact. (Unless I'm misunderstanding the output from xdebug).

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              john John K.
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: