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
(We can construct this expression with normal operators, since calling `OperatorEnum()` will `@eval` new functions on `Node` that use the specified enum.)
@@ -53,18 +53,18 @@ First, what happens if we naively use Julia symbols to define and then evaluate
53
53
This is quite slow, meaning it will be hard to quickly search over the space of expressions. Let's see how DynamicExpressions.jl compares:
54
54
55
55
```julia
56
-
@btimeexpression(X)
56
+
@btimeexpression(X, operators)
57
57
# 693 ns
58
58
```
59
59
60
-
Much faster! And we didn't even need to compile it. (Internally, this is calling `eval_tree_array(expression, X, operators)` - where `operators` has been pre-defined when we called `OperatorEnum()`).
60
+
Much faster! And we didn't even need to compile it. (Internally, this is calling `eval_tree_array(expression, X, operators)`).
61
61
62
62
If we change `expression` dynamically with a random number generator, it will have the same performance:
63
63
64
64
```julia
65
65
@btimebegin
66
66
expression.op =rand(1:3) # random operator in [+, -, *]
0 commit comments