You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.
Currently, eval() of expression returns a const value&. And most expressions store the result that evaled to a result_ and then return it to the caller. The caller most often picks it up with a copy of the value.
So this caused two copy overhead.
The reason why most of the callers use copy of value to pick the evaled result is some of the expressions don't store the evaled result to result_:
const Value& InputPropertyExpression::eval(ExpressionContext& ctx) {
return ctx.getInputProp(prop_); // The value returned comes from the valueMap of ExecutionContext, so it shouldn't be moved by the caller
}
Moreover, it is a bit strange to store the evaled result that is only valid for the current row to the expression class.
We could let eval() return a Value and don't need to store the evaled result to result_.
Meanwhile, AggregateExpression is special. It's not stateless, so it should store the evaled result to result_.
The text was updated successfully, but these errors were encountered:
Currently,
eval()
of expression returns aconst value&
. And most expressions store the result thateval
ed to aresult_
and then return it to the caller. The caller most often picks it up with a copy of the value.So this caused two copy overhead.
The reason why most of the callers use copy of value to pick the
eval
ed result is some of the expressions don't store theeval
ed result toresult_
:Moreover, it is a bit strange to store the
eval
ed result that is only valid for the current row to the expression class.We could let
eval()
return aValue
and don't need to store theeval
ed result toresult_
.Meanwhile,
AggregateExpression
is special. It's not stateless, so it should store theeval
ed result toresult_
.The text was updated successfully, but these errors were encountered: