You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a rather big install with some big formie forms, therefore a lot of custom fields in the table (1622). When making any web request, there is a call to customFieldshttps://github.com/craftcms/cms/blob/4.5/src/elements/db/ElementQuery.php#L2110-L2119
which takes almost half a second to return and consumes a lot of CPU. The result contains all custom fields, including formie and matrix related custom fields. I ruled out that the query is slow, but was wondering, because the query, doesn´t filter global which is set as fieldContext. Is this what it should do? This happens on frontend requests and also in CP, no matter which page. As far as I understand from the callstack, this is initiated by checking the current User
Currently our site is relative slow because of that - do you know how to work around that issue besides not using big formie forms adding a lot of custom fields?
Steps to reproduce
Create a lot of custom fields (>1500)
Check response time in profiler
Expected behavior
Load only required custom fields, less CPU usage
Actual behavior
Long response times and excessive CPU usage
Craft CMS version
4.5.11.1
PHP version
8.1.21
Operating system and version
Linux 5.15.107+
Database type and version
MariaDB 10.5.23
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-50)
Installed plugins and versions
Formie 2.0.42
The text was updated successfully, but these errors were encountered:
It’s expected that all fields are queried up front, however it wasn’t necessary to be actually instantiating all of them right away.
I’ve just made a change so fields are only instantiated the first time they are actually needed for something. Until then they only will exist as the raw config data pulled from the database, which should speed things up for you.
If you’d like to test it before the next release, you can change your craftcms/cms requirement in composer.json to dev-develop as 4.5.11.1, and run composer update.
What happened?
Description
We have a rather big install with some big formie forms, therefore a lot of custom fields in the table (1622). When making any web request, there is a call to
customFields
https://github.com/craftcms/cms/blob/4.5/src/elements/db/ElementQuery.php#L2110-L2119which takes almost half a second to return and consumes a lot of CPU. The result contains all custom fields, including formie and matrix related custom fields. I ruled out that the query is slow, but was wondering, because the query, doesn´t filter
global
which is set asfieldContext
. Is this what it should do? This happens on frontend requests and also in CP, no matter which page. As far as I understand from the callstack, this is initiated by checking the current UserCurrently our site is relative slow because of that - do you know how to work around that issue besides not using big formie forms adding a lot of custom fields?
Steps to reproduce
Expected behavior
Load only required custom fields, less CPU usage
Actual behavior
Long response times and excessive CPU usage
Craft CMS version
4.5.11.1
PHP version
8.1.21
Operating system and version
Linux 5.15.107+
Database type and version
MariaDB 10.5.23
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-50)
Installed plugins and versions
The text was updated successfully, but these errors were encountered: