[Numpy-svn] [numpy/numpy] 5be93a: MAINT: memcpy-based ~4x faster, typed shuffle.

GitHub noreply at github.com
Sun Jan 17 00:24:33 EST 2016


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 5be93a2580a232705e897984d0f920bc6346990e
      https://github.com/numpy/numpy/commit/5be93a2580a232705e897984d0f920bc6346990e
  Author: Antony Lee <anntzer.lee at gmail.com>
  Date:   2016-01-16 (Sat, 16 Jan 2016)

  Changed paths:
    M doc/release/1.11.0-notes.rst
    M numpy/random/mtrand/mtrand.pyx
    M numpy/random/tests/test_random.py

  Log Message:
  -----------
  MAINT: memcpy-based ~4x faster, typed shuffle.

Only for 1d-ndarrays exactly, as subtypes (e.g. masked arrays) may not
allow direct shuffle of the underlying buffer (in fact, the old
implementation destroyed the underlying values of masked arrays while
shuffling).

Also handles struct-containing-object 1d ndarrays properly.

See #6776 for an earlier, less general (but even faster: ~6x)
improvement attempt, #5514 for the original issue.


  Commit: b8cf7f904974294d4e3af43c68ef23f87385f2f6
      https://github.com/numpy/numpy/commit/b8cf7f904974294d4e3af43c68ef23f87385f2f6
  Author: Antony Lee <anntzer.lee at gmail.com>
  Date:   2016-01-16 (Sat, 16 Jan 2016)

  Changed paths:
    M numpy/random/mtrand/mtrand.pyx

  Log Message:
  -----------
  Top shuffle speed for machine-sized ints/floats.

Apparently gcc only specializes one branch (the last one) so I went for
another 33% performance increase (matching #6776) in what's likely the
most common use case.


  Commit: 309fdd4cd1400fc392acfa418226bd7f8b10073d
      https://github.com/numpy/numpy/commit/309fdd4cd1400fc392acfa418226bd7f8b10073d
  Author: Antony Lee <anntzer.lee at gmail.com>
  Date:   2016-01-16 (Sat, 16 Jan 2016)

  Changed paths:
    M numpy/random/tests/test_random.py

  Log Message:
  -----------
  Revert to non-generative test.


  Commit: afd11746fc4e0f0c06c6331798bf66520183de4d
      https://github.com/numpy/numpy/commit/afd11746fc4e0f0c06c6331798bf66520183de4d
  Author: Nathaniel J. Smith <njs at pobox.com>
  Date:   2016-01-17 (Sun, 17 Jan 2016)

  Changed paths:
    M doc/release/1.11.0-notes.rst
    M numpy/random/mtrand/mtrand.pyx
    M numpy/random/tests/test_random.py

  Log Message:
  -----------
  Merge pull request #6933 from anntzer/fastshuffle-memcpy

memcpy-based fast, typed shuffle.


Compare: https://github.com/numpy/numpy/compare/947b023a4999...afd11746fc4e


More information about the Numpy-svn mailing list