numpy/numpy — pull request #4721 by juliantaylor (2014-05-16 16:59:03+00:00)
Title: ENH: avoid expensive PyArg_ParseTuple in void operations

Replace simple "Oi|O" unpack with faster specialized unpacking

Improves e.g.:

nrows, ncols = 365, 10000
items = np.rec.fromarrays(randn(2,265, 10000), names=['widgets','gadgets'])
row_idx, colidx = randint(0, nrows, ncols), np.arange(ncols)
%timeit filtered_items = items[row_idx, col_idx]
In [7]: %timeit filtered_items = items[row_idx, col_idx]
1000 loops, best of 3: 1.55 ms per loop

to

In [7]: %timeit filtered_items = items[row_idx, col_idx]
1000 loops, best of 3: 706 µs per loop