[SERVER-20419] NetworkInterfaceASIO spends 70% of its cycles in vector::erase Created: 15/Sep/15 Updated: 07/Oct/15 Resolved: 18/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | None |
| Fix Version/s: | 3.1.9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Adam Midvidy | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Platform 9 (09/18/15) |
| Participants: |
| 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. |
| Comments |
| Comment by Githook User [ 18/Sep/15 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: |