Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5789

Implements batch ByteBuf::indexOf

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.3
    • Component/s: BSON
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Currently ByteBufferBsonInput::readCString relies on an suboptimal byte per byte search for string termination: in Netty contains a SWAR indexOf method which could be (re)used to speed this operation, leveraging different concrete implementation based on the different ByteBuf concrete classes (see https://github.com/netty/netty/pull/10737.).

      This will both save megamorphic single byte operations, including bound checks, accessibility checks, etc etc and reducing the number of branches (and misses, by consequence).

       

            Assignee:
            slav.babanin@mongodb.com Slav Babanin
            Reporter:
            nigro.fra@gmail.com Francesco Nigro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None