Alexey Serbin has submitted this change and it was merged. (
Change subject: Fix move constructors to be noexcept
Fix move constructors to be noexcept
I noticed while looking at a profile of a tablet server starting up that
I saw a lot of CPU used in stacks like:
Digging into the source of std::vector, I saw that the emplace_back_aux
function is used when emplacing requires resizing the underlying array.
Since scoped_refptr has a move constructor I was surprised to see it
using AddRef() here during the array expansion. In fact it turns out
that std::vector<> will only use the move constructor when it is marked
'noexcept', which ours was not.
I verified this with a simple test program as well. If the move
constructor is marked 'noexcept', it is called. Otherwise, it is not.
This patch corrects scoped_refptr as well as a few other spots where we
had move constructors without noexcept.
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <aser...@cloudera.com>
7 files changed, 17 insertions(+), 17 deletions(-)
Kudu Jenkins: Verified
Alexey Serbin: Looks good to me, approved
To view, visit http://gerrit.cloudera.org:8080/9382
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Owner: Todd Lipcon <t...@apache.org>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>