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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.1.9
    • Affects Version/s: None
    • Component/s: Networking
    • None
    • Fully Compatible
    • ALL
    • Platform 9 (09/18/15)
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

        1. perf.png
          160 kB
          Adam Midvidy

            Assignee:
            Andrew Morrow (Inactive)
            Reporter:
            Adam Midvidy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: