Problem/Motivation
Function brings additional overhead for comment render by looping each comment listing and initializing
It doesn't do anything by itself, it only sets 'divs/divs_final' properties in comment entities, which are only used in one place: CommentViewBuilder::alterBuild(). (Formerly comment_view($comment), see commit #e9ca778b)
The comment that is in the code now
// The $divs element instructs #prefix whether to add an indent div or
// close existing divs (a negative value).
...doesn't make any sense by itself, and clearly refers to the code that is now in alterBuild(). The whole function should be moved into CommentViewBuilder.
And since it doesn't make any sense by itself, in this case I don't think it even needs marking @deprecated. The function removal can be marked in https://www.drupal.org/node/2299799 (if we don't care about the version number mentioned in there being exactly right).
Proposed resolution
Remove the function by incorporating it into \Drupal\comment\CommentViewBuilder::buildComponents()
where it actually used.
Comment entity should not be changed by build/render layer.
Remaining tasks
agree on approach, commit
User interface changes
no
API changes
Removes comment_prepare_thread()
as no longer needed and buggy.
Beta phase evaluation
Issue category | Bug because changes entity properties without need and degrades performance. |
---|---|
Issue priority | Major because affects performance and d.o |
Prioritized changes | The main goal of this issue is performance and removal of useless code. |
Disruption | Not disruptive for core/contributed and custom modules/themes because it used only internally and the functionality incorporated into CommentViewBuilder |