title: Performance nested loop in numba
body: <p>For performance reasons, I have started to use Numba besides NumPy. My Numba algorithm is working, but I have the feeling that it should be faster. There is one point which is slowing it down. Here is the code snippet:</p>
  
  <pre><code>@nb.njit
  def rfunc1(ws, a, l):
      gn = a**l
      for x1 in range(gn):
          for x2 in range(gn):
              for x3 in range(gn):
                  y = 0.0
                  for i in range(1, l):
                      if numpy.all(ws[x1][0:i] == ws[x2][0:i]) and
                      numpy.all(ws[x1][i:l] == ws[x3][i:l]):
                          y += 1
                      if numpy.all(ws[x1][0:i] == ws[x2][0:i]) and 
                      numpy.all(ws[x1][i:l] == ws[x3][i:l]):
                          y += 1
  </code></pre>
  
  <p>In my opinion the <code>if</code> command is slowing it down. Is there a better way? (What I try to achieve here is related to a previous posted problem: <a href="https://stackoverflow.com/questions/41029617/count-possibilites-for-single-crossovers">Count possibilites for single crossovers</a>) <code>ws</code> is a NumPy array of size <code>(gn, l)</code> containing <code>0</code>'s and <code>1</code>'s </p>