The exec used in the __call__ method is slow! | |
Think of a hardcoded function,
def f1(x): return sin(x) + x**3 + 2*xand the corresponding StringFunction-like objects | |
Efficiency test (time units to the right):
f1 : 1 StringFunction_v1: 13 StringFunction_v2: 2.3 StringFunction_v3: 22Why? | |
eval w/compile is important; exec is very slow |