lang: Improve graph shape with speculative execution
Most of the time, we don't need to have a dynamic call sub graph, since the actual function call could be represented statically as it originally was before lambda functions were implemented. Simplifying the graph shape has important performance benefits in terms of both keep the graph smaller (memory, etc) and in avoiding the need to run transactions at runtime (speed) to reshape the graph. Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
This commit is contained in:
@@ -1321,6 +1321,9 @@ func (obj *FuncValue) Value() interface{} {
|
||||
// inappropriate input types, or if it returns an inappropriate output type.
|
||||
func (obj *FuncValue) Call(ctx context.Context, args []Value) (Value, error) {
|
||||
// cmp input args type to obj.T
|
||||
if obj.T == nil {
|
||||
return nil, fmt.Errorf("the type is nil")
|
||||
}
|
||||
length := len(obj.T.Ord)
|
||||
if length != len(args) {
|
||||
return nil, fmt.Errorf("arg length of %d does not match expected of %d", len(args), length)
|
||||
|
||||
Reference in New Issue
Block a user