Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-20749

Improve sitemesh decoration performance

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • 3.4-m4
    • None
    • None
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Each time a sitemesh decorator is applied in Confluence, the content of that decorator is buffered not once but three times. Here is some example offending code:

              StringWriter bodyBuffer = new StringWriter();
              page.writeBody(OutputConverter.getWriter(bodyBuffer));
              context.put("body", bodyBuffer.toString());
      

      So we have:

      1. The original sitemesh page buffer
      2. The StringWriter buffer (which as it grows will copy itself many times over)
      3. The character array in the String array produced by the bodyBuffer

      This happens several times per request, once for the main page and several times as various components use the #applyDecorator velocity directive.

      This need not be the case, velocity has a Renderable interface, that allows you to write directly to velocities writer, without buffering the page into a String, so that each time a decorator is applied, the content is only buffered once.

      Attachments

        Activity

          People

            jroper James Roper [Atlassian]
            jroper James Roper [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: