Optimize getCommentedEntity()

Created on 5 October 2015, about 9 years ago
Updated 22 November 2023, 12 months ago

Click on the right hand side of https://www.dropbox.com/s/dqc7duebdzzr88d/result-node1-no-page-cache-fla... in the bar called Drupal\comment\CommentLazyBuilders::renderLinks. There you will see a wide bar for getCommentedEntity(). This method can be optimized to pull right from persistent entity cache if available.

Incidentally, I notice that buildLinks() calls $entity->getCommentedEntityTypeId() and $entity->getCommentedEntityId() despite having been passed in the commented entity.

Why this issue should be an rc target

This change will enable a significant performance improvement. @todo What are the potential disruptions, if any?FIxed test :)

Remaining tasks

- Once this is committed in the og project the getFieldValue method can be remove. See https://github.com/Gizra/og/pull/555

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Commentย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States moshe weitzman Boston, MA

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • needs profiling

    It may affect performance, and thus requires in-depth technical reviews and profiling.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024