Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-75722

Avoid memory copies on gRPC's read path

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Service Arch

      We use a custom memory layout for our SharedBuffer objects, which reserve a few bytes at the beginning of each contiguous memory region for metadata (e.g., the capacity of the buffer). As a result, we cannot have SharedBuffer own the memory allocated by gRPC to read from a server stream. This requires an additional heap allocation and memory copy on the critical path.

      We can avoid the copy by either changing the layout of the byte-array sent through gRPC streams, or modify SharedBuffer to accepts raw buffers.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: