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

NetworkInterfaceASIO spends 70% of its cycles in vector::erase

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.9
    • None
    • Networking
    • None
    • Fully Compatible
    • ALL
    • Platform 9 (09/18/15)

    Description

      Because we store the operations that are waiting for a connection from the pool as a std::vector<TaskExecutor::CallbackHandle>, we need to do an O(n) scan to remove it when we move it to the _inProgressMap.

      Under load (10's of thousands of concurrent ops) the cost of traversing this vector dominates the total time of an operation. This has been verified by profiling with the linux perf utility, the output of which is attached to this ticket.

      To remedy this, we should make CallbackHandles hashable so that we can use a better data structure with O(1) insert/removal.

      Attachments

        Activity

          People

            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            adam.midvidy Adam Midvidy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: