Dan Hecht has posted comments on this change. ( http://gerrit.cloudera.org:8080/8215 )
Change subject: IMPALA-5142 EventSequence displays negative elapsed time. ...................................................................... Patch Set 4: (3 comments) http://gerrit.cloudera.org:8080/#/c/8215/5/be/src/util/runtime-profile-counters.h File be/src/util/runtime-profile-counters.h: http://gerrit.cloudera.org:8080/#/c/8215/5/be/src/util/runtime-profile-counters.h@327 PS5, Line 327: int64_t prev = 0L; : for (const Event& event: events_) { rather than creating a tmp eventlist_sorted, you should create a temp for this lamba (you can use "auto" for that), since it's used twice and must be consistent in order for this code to make sense. http://gerrit.cloudera.org:8080/#/c/8215/5/be/src/util/runtime-profile-counters.h@330 PS5, Line 330: = false; our style uses ! rather than == false http://gerrit.cloudera.org:8080/#/c/8215/4/be/src/util/runtime-profile-counters.h File be/src/util/runtime-profile-counters.h: http://gerrit.cloudera.org:8080/#/c/8215/4/be/src/util/runtime-profile-counters.h@326 PS4, Line 326: bool eventlist_sorted = true; : int64_t prev = 0L; : for (const Event& event: events_) { : if (event.second < prev) { : eventlist_sorted = false; : break; : } : prev = event.second; : } : > Since the list is sorted in most of the times calling sort() may be expensi the flipside is that this becomes a cliff in the sense that normally it will be fast, but every once in a while (when the race occurs), we'll pay the cost of sort(). If we always call sort(), then the performance is more predictable. I don't think the event list will ever be so long that this matters one way or another, so simplest seems best. That said, I don't feel strongly if you really want to keep the check. -- To view, visit http://gerrit.cloudera.org:8080/8215 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8c944396d96473b17b453da3e913ffc56680a896 Gerrit-Change-Number: 8215 Gerrit-PatchSet: 4 Gerrit-Owner: Pranay Singh Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com> Gerrit-Reviewer: Pranay Singh Gerrit-Comment-Date: Wed, 01 Nov 2017 22:31:42 +0000 Gerrit-HasComments: Yes