Problem/Motivation
As a follow-up #3562989: Implements RevisionLogInterface for Instance entity. We are calculating the hash everytime we need (for display in LogsPanel or to check data changes):
class Instance extends ContentEntityBase implements InstanceInterface {
public function getPublishedHash(): ?int {
$published_data = $this->getBuildablePlugin()->getSources();
return $published_data ? self::getUniqId($published_data) : NULL;
}The logic is simple but it seems costly.
Proposed resolution
Because data is more often retrieved than saved, can we calculate the hash when we save the data instead ?
It will increase logic complexity (we need to save in both the live instance and in the permanent "published" storage) but it may increase performance.
How can we evaluate this performance gain, in order to decide if it is worth the hassle?
Issue fork display_builder-3595491
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
pdureau commentedSome pipeline fails, but there are OK on my local environment. Weird.
Comment #4
pdureau commentedIt may be because my local environment follows
ui_patterns:2.0.xwhen CI needsui_patterns:2.0.15because if i switch locally toui_patterns:2.0.15, I have the same fails.Let's wait
ui_patterns:2.0.16