numpy/numpy — pull request #3521 by arinkverma (2013-07-12 12:36:31+00:00)
Title: ENH: Avoiding NPY_BEGIN_THREADS for small arrays can speed-up trivial_three_operand_loop by 5%

In trivial_three_operand_loop from ufunc_object.c, avoiding NPY_BEGIN_THREADS for small arrays, can speed-up function by 5%.

As releases of GIL, then quickly restoring just after small operation doesn't provide much benefit.

Before
----------

In [2]: x = np.asarray(5.0)
In [3]: timeit x+x
1000000 loops, best of 3: 1.99 us per loop

After
-------

In [3]: timeit x+x
1000000 loops, best of 3: 1.71 us per loop