title: Numba acceleration on nested funtions
body: <p>I have tried to use numba to <a href="https://stackoverflow.com/questions/54359670/use-numba-on-lambda-function">accelerate lambda function</a> but I failed to do so. Seems like lambda is not supported by numba. So I rewrote the lambda function as def functions. I am constructing an implicit function f(x,y,z) = x^2+y^2-z^2 and some others, which will only be evaluated once after construction. xi,yi,zi are for translation of the implicit function.</p>
  
  <pre><code>def wrapperNode(xi,yi,zi,R):
  
      @nb.jit(nopython=True)
      def Node(x,y,z):
          x = xi - x
          y = yi - y
          z = zi - z
          return x**2 + y**2 - z**2
  
      return Node
  
  import time
  for i in range(10):
      Start = time.time()
      Node = wrapperNode(i+1.0,i+2.0,i+3.0,i+4.0)
      a = Node(1.0,2.0,3.0)
      Final = time.time()
      print(Final-Start)
  </code></pre>
  
  <p>Time result for each loop:</p>
  
  <pre><code>0.137923002243042
  0.14062094688415527
  0.14144468307495117
  0.1332840919494629
  0.12716078758239746
  0.14055514335632324
  0.14062023162841797
  0.1423487663269043
  0.14061713218688965
  0.1943662166595459
  </code></pre>
  
  <p>It was actually much slower than simply evaluate the Node function in the wrapper function. Every time I changed the input arguments for the wrapper function, the computer has to compile the Node function if I evaluate it. So no acceleration at all...I am looking for a way to accelerate the entire wrapper function. If anyone has any idea, please help. Thank you!</p>