Implements batch ByteBuf::indexOf

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.11.3
    • Component/s: BSON
    • None
    • Java Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • 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
            Reporter:
            Francesco Nigro
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: