Alexey Serbin 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(); : } > yea, if you compile in clang it turns it into a constant time operation. g+ Thank you for looking at this. Just FYI: even with noinline, clang 3.5 with -O2 gives slightly better results on ve0518: new: real 0m1.485s user 0m1.486s sys 0m0.000s old: real 0m1.997s user 0m1.999s sys 0m0.001s The fact that the function can be easily inlined and get better result is a good sign, IMO. Especially given the fact we usually use clang++ to compile our binaries. However, it's a minor thing and I agree it's not worth updating if the incentive to do so is low. -- 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
