APIv4 - Fix performance drag caused by getInfoItem calling the API
authorColeman Watts <coleman@civicrm.org>
Sat, 23 Oct 2021 23:27:21 +0000 (19:27 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 23 Oct 2021 23:27:21 +0000 (19:27 -0400)
commitb74d4d5cd30fc5fb8cc6c9f7b4e1d648de251fe1
tree646058381b2a94e5cb706029e8c99c69a0661074
parent90da0571599491ca2aba52462b595b2573215a69
APIv4 - Fix performance drag caused by getInfoItem calling the API

This function is sometimes called thousands of times per request, e.g. for every cell
in a searchKit display table. Going through the API wrapper that many times is a
considerable (+10 sec) drag on performance.
Instead of calling Entity.get, we can just read directly from the cache where it stores its data.
Civi/Api4/Utils/CoreUtil.php