[SERVER-20642] ThreadPool should use std::deque instead of std::list to hold _pendingTasks Created: 25/Sep/15  Updated: 07/Oct/15  Resolved: 25/Sep/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.1.9

Type: Improvement Priority: Minor - P4
Reporter: Adam Midvidy Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platform A (10/09/15)
Participants:

 Description   

While profiling network_interface_asio_integration_test, which uses a ThreadPool, I found that ~60% of cycles were spent in ThreadPool::schedule(). Changing _pendingTasks from a list to a deque made schedule() take a more reasonable amount of time. The culprit is probably libstdc++ not implementing list::size as an O(1) operation, despite that being mandated by the C++11 standard.



 Comments   
Comment by Githook User [ 25/Sep/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-20642 store ThreadPool's _pendingTasks in a std::deque
Branch: master
https://github.com/mongodb/mongo/commit/90da032da6609e35ef56e63935b9cbb38e0cc4b8

Generated at Thu Feb 08 03:54:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.