[Numpy-svn] [numpy/numpy] 25518e: ENH: improve VOID_compare performance

GitHub noreply at github.com
Wed May 28 21:24:26 EDT 2014


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 25518e5833b1590f849e189941173563ef2548e1
      https://github.com/numpy/numpy/commit/25518e5833b1590f849e189941173563ef2548e1
  Author: Julian Taylor <jtaylor.debian at googlemail.com>
  Date:   2014-05-26 (Mon, 26 May 2014)

  Changed paths:
    M numpy/core/src/multiarray/arraytypes.c.src

  Log Message:
  -----------
  ENH: improve VOID_compare performance

use small memory cache for the temporary data allocation in the compare
loop and use npy_is_aligned instead of the very expensive signed
division.

Improves unaligned compares which occur in structured arrays with
strings:

d = np.ones((2,10000), dtype=np.dtype([('f0', 'S5'), ('f1', '<i4')]))
%timeit np.argsort(d)
100 loops, best of 3: 8.6 ms per loop

vs before:
100 loops, best of 3: 23.7 ms per loop


  Commit: 4d61a3235989ff64a1715e3a8273bff5cd7aeb60
      https://github.com/numpy/numpy/commit/4d61a3235989ff64a1715e3a8273bff5cd7aeb60
  Author: Charles Harris <charlesr.harris at gmail.com>
  Date:   2014-05-28 (Wed, 28 May 2014)

  Changed paths:
    M numpy/core/src/multiarray/arraytypes.c.src

  Log Message:
  -----------
  Merge pull request #4746 from juliantaylor/void-compare-opt

ENH: improve VOID_compare performance


Compare: https://github.com/numpy/numpy/compare/c243ca7b2053...4d61a3235989


More information about the Numpy-svn mailing list