Todd Lipcon has posted comments on this change.

Change subject: [rpc] faster generation of KRPC call ID
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/7813/2//COMMIT_MSG
Commit Message:

PS2, Line 48:   const int u_bound = 800000000 + (random() % 100);
            :   int n = 0;
            :   for (int i = 0; i < u_bound; ++i) {
            :     n = next_id();
            :   }
> Yep, I suspected that it's not a good benchmark, but the newer code looked 
yea, if you compile in clang it turns it into a constant time operation. g++ on 
my machine isn't quite smart enough but it seems it is on yours, perhaps. 
Adding the noinline attribute on the function breaks that optimization of 
course and it goes back to being the same speed.

Either way, I think it's a "if it aint broke dont fix it" scenario IMO


-- 
To view, visit http://gerrit.cloudera.org:8080/7813
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I03726343d222bcd241c2c2a5a1670a672f8e5cb6
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to