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

optimizations in inlined_storage and dynamic_bitset

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc8
    • Affects Version/s: None
    • Component/s: None
    • Service Arch
    • Fully Compatible
    • v8.0
    • Service Arch 2024-04-29, Programmability 2024-05-27, Programmability 2024-06-10

      I would prefer to eliminate the inlined_storage.h header from util, since we are adding a more general inline_allocator.h and discoverability will be reduced with two similar components.

      inlined_storage has got features that are specific to dynamic bitset and doesn't really need to be in a header that indicates general purpose application.

      e.g.:

      Terminology of "block type" is really an element type, but in the context of dynamic bitset, it is a block of bits.

      The `kBlockSize` is a bit count (useful only for dynamic bitset). It's just CHAR_BIT times the `sizeof(BT)`.

      It requires trivial `BT` (block type). Containers shouldn't need this.

      Some needed improvements incidentally, with it:

      move operations need to be noexcept

      Set of comparison operators are incomplete and should be friend inline defs.

      ostream operator<< are not usually defined for generic containers, but this has one. The blocks stored by a dynamic bitset are not values so it's unclear what the significance of its streamified form should be. This operation should only happen at a higher, specific, layer.

      The "allOf" and "anyOf" friend functions should be removed. Element iterators and the standard std::any_of and std::all_of should be able to handle this. These operations are not necessary for an inline storage class, but they are used to build operations for dynamic_bitset, so they should be defined there.

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: