Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3918

Improve transfer buffer utilization for Clobs

    XMLWordPrintableJSON

Details

    • Normal
    • Performance

    Description

      Read DERBY-3769 for details.

      Briefly, for Clobs containing ASCII characters the content is sent over the network in smaller chunks than necessary. The reason is because the network server is unaware of how many bytes a range of characters results in when they are encoded as modified UTF-8. As exceeding the maximum size is very costly, a defensive assumption of 3 bytes per char is used. This leads to sending only 10890 bytes over the wire per round-trip instead of up to 32672 for ASCII content.

      The same goes for Clobs with chars encoded by 2 bytes, or Clobs with mixed content.

      A few ideas on how to solve this:

      • read chars in chunks, look at each char to calculate byte length and read chars until byte buffer will be filled sufficiently
      • add new method to Engine[C]LOB
      • rewrite implementation to work on the byte level instead of the character level (this would be an internal API only)
      • add and make use of more information about the Clob content, i.e. if it consists of only 1 byte per char encodings.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kristwaa Kristian Waagan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: