This issue has been created
There are 2 updates.
 
 
XWiki Rendering / cid:jira-generated-image-avatar-aaf2e1cf-d883-4545-8ffa-4b2c4808d38b XRENDERING-834 Open

Each new chaining listener inspects the methods of its class hierarchy with reflection

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-98d5b963-0447-40cf-8e50-21cdb67644f0 Michael Hamann created this issue on 18/Nov/26 17:11
 
Summary: Each new chaining listener inspects the methods of its class hierarchy with reflection
Issue Type: cid:jira-generated-image-avatar-aaf2e1cf-d883-4545-8ffa-4b2c4808d38b Improvement
Affects Versions: 13.10.3
Assignee: Unassigned
Components: API
Created: 18/Nov/26 17:11
Labels: performance
Priority: cid:jira-generated-image-static-major-f5f2adc6-df5f-4ac8-9a3d-43b5cd556261 Major
Reporter: Michael Hamann
Description:

Since XRENDERING-644, the constructor of AbstractChainingListener calls getDeclaredMethods() on each class of the listener's hierarchy to detect subclasses that only implement the old signatures of endListItem() / onImage(). getDeclaredMethods() copies all Method objects on each call, and chaining listeners are created very often: renderers are per-lookup components, and for example every $services.localization.render() call creates a plain text renderer with its chain of listeners.

On a local profile of Sandbox.WebHome (standard flavor, master), this check takes 4.2% of the request CPU.

Change

Compute the result once per listener class with a ClassValue, which keeps the value on the class itself, so classes of uninstalled or upgraded extensions are still garbage collected and a new version of a class gets its own result.

 
 

2 updates

 
cid:jira-generated-image-avatar-98d5b963-0447-40cf-8e50-21cdb67644f0 Changes by Michael Hamann on 18/Nov/26 17:11
 
Fix Version: 18.10.0-rc-1
Assignee: Michael Hamann