Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-834

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 18.10.0-rc-1
    • 13.10.3
    • API
    • Unknown
    • N/A
    • N/A

    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.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: