Todd Lipcon has posted comments on this change. Change subject: [util] use emplace() instead of insert() ......................................................................
Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/6807/1/src/kudu/gutil/map-util.h File src/kudu/gutil/map-util.h: Line 364: pair<typename Collection::iterator, bool> ret = collection->emplace(key, value); > I think you are right, but that would be another level of optimization. As hm, I'm not sure I believe that it makes a difference... I wrote this test program: https://gist.github.com/075a7dfe3db157893af526078968ba25 which puts shared_ptr<>s in a map, so that there is a non-trivial copy constructor (incrementing ref count), and found that there was no difference between these options. The optimizer's probably smart enough to see where it can do these optimizations as is -- To view, visit http://gerrit.cloudera.org:8080/6807 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic40b17d9315d7c42d589fd30ce55242540e7767f Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes