sjsxp
  1. sjsxp
  2. SJSXP-64

Ability to adjust default buffer sizes

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      64

      Description

      The memory requirement by SJSXP for small XML messages is high relative to the
      size of the message.

      For small messages (around 500 bytes), there is in excess of 60x memory
      overhead. Most of this overhead comes from two buffers:

      • the buffer used to hold bytes from the initial InputStream.
      • the buffer used to hold decoded XML (e.g. in the UTF8Reader).

      I'm not entirely sure why the first buffer is needed at all but nevertheless
      both buffers' initial size is 8192. Given that the second buffer is a char[],
      these buffers alone take up around 25K which is significant when the messages
      are small.

      There is the following comment in the source code:

      /**

      • Buffer size. We get this value from a property. The default size
      • is used if the input buffer size property is not specified.
      • REVISIT: do we need a property for internal entity buffer size?
        */

      I think it would be a good enhancement to reduce the default buffer size when
      messages are really small.

      This could be done in three ways:

      • through a system property (perhaps a bit too coarse grained but useful for
        running performance tests).
      • through a property on the factory (good since it can be specific to a piece of
        functionality in which the XML messages are around the same size).
      • adaptive, i.e. learns based on message sizes (requires some kind of
        co-ordination).

      As a start, I think it would be good to provide the first two options out of the
      box.

        Activity

        Hide
        Joe Wang added a comment -

        Thanks for the suggestion! It looks like a nice performance improvement.
        Unfortunately I have been quite occupied and I'm on vacation for a month. I'll
        look into it once I come back.

        Show
        Joe Wang added a comment - Thanks for the suggestion! It looks like a nice performance improvement. Unfortunately I have been quite occupied and I'm on vacation for a month. I'll look into it once I come back.

          People

          • Assignee:
            Joe Wang
            Reporter:
            jeffrey_sinclair
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: