-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
Api4 - Use global cache for entityFields #32210
base: master
Are you sure you want to change the base?
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
// Also reset $_entityFields | ||
$entityFieldsProperty = $reflection->getProperty('_entityFields'); | ||
$entityFieldsProperty->setAccessible(TRUE); | ||
$entityFieldsProperty->setValue($apiRequest, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the changes to entityFields caching being moved out of the class itself, this is no longer necessary. The above lines changing _entityName
will have the same effect since entityFields
now keys its cache off of that.
Hi @colemanw - this is a tremendous boost in both speed and RAM savings. This call used to consume 190MB, now it consumes 1.6MB. It used to take 36.4 seconds while sending 1000 emails, now it takes 0.3 seconds. Now, having removed that bottleneck, I can see that there's a place where the API3 |
Some of the test failures seem to be related here @colemanw |
Fixes dev/core#5757 Instead of caching entityFields once per instance, cache once per entity/action.
44bdf2a
to
f9fd08d
Compare
@colemanw I think the test fails relate still |
@seamuslee001 no those same 7 tests are failing for other PRs. |
Overview
Api4 performance improvement: fewer calls to getFields, more caching.
Fixes dev/core#5757
Technical Details
Instead of caching entityFields once per instance, cache once per entity/action.