Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10745 Serialization and copy improvements for record writer
  3. FLINK-9913

Improve output serialization only once in RecordWriter

    XMLWordPrintableJSON

Details

    Description

      Currently the RecordWriter emits output into multi channels via ChannelSelector  or broadcasts output to all channels directly. Each channel has a separate RecordSerializer for serializing outputs, that means the output will be serialized as many times as the number of selected channels.

      As we know, data serialization is a high cost operation, so we can get good benefits by improving the serialization only once.

      I would suggest the following changes for realizing it.

      1. Only one RecordSerializer is created in RecordWriter for all the channels.
      2. The output is serialized into the intermediate data buffer only once for different channels.
      3. The intermediate serialization results are copied into different {{BufferBuilder}}s for different channels.

      An additional benefit by using a single serializer for all channels is that we get a potentially significant reduction on heap space overhead from fewer intermediate serialization buffers (only once we got over 5MiB, these buffers were pruned back to 128B!).

      Attachments

        Issue Links

          Activity

            People

              zjwang Zhijiang
              zjwang Zhijiang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: