Hussain Towaileb has posted comments on this change. Change subject: [WIP] Code generator alternative ......................................................................
Patch Set 8: (1 comment) https://asterix-gerrit.ics.uci.edu/#/c/3043/8/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/PointableHelper.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/PointableHelper.java: PS8, Line 161: IPointable argument > In addition, even if we determine that varargs introduces some performance You may check "Patch Set 6" as a reference for using varargs, the code is much cleaner, and for most functions, it's a single call without any null flags. However, due to lack of experience, I can't tell precisely how much of an impact would using varargs cause. Another alternative, although not as clean, since the issue is, I can't tell the number of arguments, I was considering making a private method in each evaluator class, its arguments match the number of arguments the method is receiving, and let that method deal with the checking. Example (simplified): evalLeft.evaluate(tuple, argLeft); evalRight.evaluate(tuple, argRight); if (handleMissingAndNull(result, argLeft, argRight)) { return; } // and at the bottom of the class private boolean handleMissingAndNull(result, argLeft, argRight) { // Here we move all the code for checking the arguments one at a time // if end result is missing or null, return true; // otherwise, return false; } So basically it's the same as the current solution, but we move all the code to another private method, this way we maintain the cleanness of the evaluate(...) method. Each class will have such a method with signature matching the number of argument coming, and hence, no need for varargs. And for the cases that have loops, those can be handled separately since they're just a few. -- To view, visit https://asterix-gerrit.ics.uci.edu/3043 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icca2e2128c4b0f2bfd8675655cf5296cbbaeba88 Gerrit-PatchSet: 8 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Dmitry Lychagin <[email protected]> Gerrit-Reviewer: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-HasComments: Yes
