Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295206

Do not attempt field storage write when field content did not change

$
0
0

I tested on a profile2 entity save, with numerous fields, changing one one value.

Without patching the field API, I got 409 SQL queries with about 98 DELETE, 144 SELECT, and 36 INSERTS ; Others are just modules reacting upon hooks and bootstrap. Once applied, it lowered to a total of 54 SQL queries all inclusive (same query). [Actually those result were the result of an erroneously catched AJAX request]

My xdebug stack trace, which actually weights 12 M (which is huge) went down to 11 M (which is not really significant, but 1 Mo on a less bloated site is a lot). I couldn't find any significant CPU abnomalies due to field values deep comparison. [EDIT: This is still true after catching the right profile trace, even better since it lowered to 10 M]

Doing deep array comparison for field values upon the original entity property did this, I excluded field data from writing whenever they match.

This probably cause a effing lot of CPU consumption but I guess that in other scenarios such as Commerce site order/cart update or delete, this might actually drastically the SQL concurrency and give a serious backend performance boost, at the cost of a maybe significant frontend CPU load.

So, I'm just testing for fun, if tests passes I'd try on some live sites.


Viewing all articles
Browse latest Browse all 295206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>