Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-9201

Add CharsetEncoderUtil to speed up char encoding

    Details

      Description

      There is a data type mismatch between data processing and data transfer in web applications.

      We need to generate the page and process it by chars, but finally we need to send it out by sockets which can only handle bytes. So we need to encode chars to bytes all the time.

      String class provides a getBytes() method which can to the encode automaticly, but it is not very effective, because it does a few unnecessay copy protection. To avoid these copying i create a CharsetEncoderUtil which utilize NIO's encoding mechanism directly. This can save a lot of temp encoding buffers.

      MessageBoard benchmark result shows that this fix can save about 3% young gen collections

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              shuyang.zhou Shuyang Zhou
              Participants of an Issue:
              Recent user:
              Esther Sanz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 51 weeks, 3 days ago

                Packages

                Version Package
                6.0.1 RC
                6.0.2 RC